如何在腾讯云上部署 Facebook 的ParlAI 训练框架

刚看到腾云阁新一期的活动又开始了,跃跃欲试,恰巧看到ParlAI我就把安装过程记录一下。

必备环境:

python3

ZeroMq

安装命令:

git clone https://github.com/facebookresearch/ParlAI.git
cd ParlAI
python setup.py develop

安装过程中问题一:

UnicodeDecodeError: 'gbk' codec can't decode byte 0x9d in position 1270: illega
解决方法:我把setup.py代码稍加修改了。 都是utf-8的 我这里很疑惑
去掉:
with open('LICENSE') as f:
    license = f.read()

with open('requirements.txt') as f:
    reqs = f.read()
初始化:
 license='',
 long_description='',

问题二:

“error: Microsoft Visual C++ 14.0 is required..
解决办法:

手工安装

pip install pyzmq

问题三:

AttributeError: module 'parlai.tasks.babi.agents' has no attribute 'create_agents'
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没
有反应,连接尝试失败。
解决办法:
安装ZeroMq 

运行案例:

F:\py\parlai\ParlAI>python examples/display_data.py -t babi:task1k:1
[no_images:False]
[download_path:f:\py\parlai\parlai\downloads]
[task:babi:task1k:1]
[datatype:train]
[batchsize:1]
[num_examples:10]
[numthreads:1]
[parlai_home:f:\py\parlai\parlai]
[datapath:f:\py\parlai\parlai\data]
[creating task(s): babi:task1k:1]
[building data: f:\py\parlai\parlai\data\bAbI]
100% [....................................................] 19212062 / 19212062
unpacking babi.tar.gz
[DialogTeacher initializing.]
[loading fbdialog data:f:\py\parlai\parlai\data\bAbI\tasks_1-20_v1-2\en-valid-n
sf\qa1_train.txt]
[babi:task1k:1]: Mary travelled to the garden.
Daniel went to the office.
Where is Daniel?
[labels: office]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: office
~~
[babi:task1k:1]: Daniel travelled to the kitchen.
Sandra journeyed to the kitchen.
Where is Daniel?
[labels: kitchen]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: kitchen
~~
[babi:task1k:1]: Mary went back to the hallway.
Daniel went to the bedroom.
Where is Daniel?
[labels: bedroom]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: bedroom
~~
[babi:task1k:1]: Mary moved to the bathroom.
Sandra journeyed to the bathroom.
Where is Mary?
[labels: bathroom]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: bathroom
~~
[babi:task1k:1]: John journeyed to the garden.
Sandra went to the garden.
Where is Sandra?
[labels: garden]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: garden
- - - - - - - - - - - - - - - - - - - - -
~~
[babi:task1k:1]: Mary travelled to the bedroom.
Daniel travelled to the office.
Where is Mary?
[labels: bedroom]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: bedroom
~~
[babi:task1k:1]: Daniel journeyed to the hallway.
Mary travelled to the hallway.
Where is Mary?
[labels: hallway]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: hallway
~~
[babi:task1k:1]: Sandra travelled to the kitchen.
Mary travelled to the kitchen.
Where is Daniel?
[labels: hallway]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: hallway
~~
[babi:task1k:1]: John journeyed to the garden.
Daniel went to the bathroom.
Where is Sandra?
[labels: kitchen]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: kitchen
~~
[babi:task1k:1]: Daniel moved to the garden.
John went to the kitchen.
Where is Daniel?
[labels: garden]
[cands: garden|kitchen|office|bedroom|bathroom|hallway]
   [RepeatLabelAgent]: garden
- - - - - - - - - - - - - - - - - - - - -
~~

原创声明,本文系作者授权云+社区-专栏发表,未经许可,不得转载。

如有侵权,请联系 yunjia_community@tencent.com 删除。

编辑于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏python成长之路

设计一个卖不同种类车的4s店

1094
来自专栏量子位

Waymo官方暴力突入指南:如何制服一辆完全自动驾驶故障车

作为自动驾驶的一枚先驱,Waymo希望无论是警方还是消防部门,都可以用不那么温柔的方式,为自动驾驶汽车的上路安全保驾护航。

562
来自专栏西枫里博客

小米4手机更换电池复活记

过年那天,手机也忙坏了,竟然自爆了(电池持续发热,熔芯了)。这大过年的没手机,春晚红包也抢不到啊,悲剧。将就先把淘汰下来的iphone5s拿来应急,这个原本是女...

402
来自专栏吴伟祥

选择VPS的位置 原

695
来自专栏微服务生态

一个火车运煤算法的思考

你是山西的一个煤老板,你在矿区开采了有3000吨煤需要运送到市场上去卖,从你的矿区到市场有1000公里,你手里有一列烧煤的火车,这个火车最多只能装1000吨煤,...

551
来自专栏听雨堂

Gis链接

资料 http://www.rytto.com/bbs/printpage.asp?BoardID=16&ID=14    西安80和北京54的投影文件 论...

16610
来自专栏HansBug's Lab

1029: [JSOI2007]建筑抢修

1029: [JSOI2007]建筑抢修 Time Limit: 4 Sec  Memory Limit: 162 MB Submit: 2382  Solve...

2566
来自专栏SAP最佳业务实践

从SAP最佳业务实践看企业管理(194)-FI-GR/IR应用

1,采购的an incoming invoice当被过帐时,必须参照(refer to) (1). a purchase order (2). a good r...

2846
来自专栏小文博客

小米MIX2正式发布——正面几乎全是屏幕

1463
来自专栏机器人网

自动驾驶汽车“无法洗车”,原因竟然在于传感器…

随着科学技术的发展,如今的自动驾驶汽车比以前更容易准确识别障碍物。但在一些常见情况的判断上,依旧称不上完美。比如说,有的自动驾驶汽车若不搭载刹车优先系统就无法穿...

2555

扫码关注云+社区