如何在腾讯云上部署 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 条评论
登录 后参与评论

相关文章

来自专栏LEo的网络日志

python技巧分享(十三)

1533
来自专栏跟着阿笨一起玩NET

C#中格式化数据的输出

alignment:可选,是一个带符号的整数,指示首选的格式化字段宽度。如果“对齐”值小于格式化字符串的长度,“对齐”会被忽略,并且使用格式化字符串的长度作为字...

530
来自专栏一个会写诗的程序员的博客

程序的基本概念

程序的基本概念 1.1. 程序和编程语言 程序(Program)告诉计算机应如何完成一个计算任务,这里的计算可以是数学运算,比如解方程,也可以是符号运算,比...

702
来自专栏张善友的专栏

.NET 4 System.Threading.Barrier 类

在Visual Studio 2010 and .NET Framework 4 Training Kit中有个System.Threading.Barrier...

1929
来自专栏信安之路

Pin-in-CTF 学习整理记录

这次打 qctf,做到了一个 ollvm,控制流平坦化的题,虽然不是很明白原理(但这么叫感觉很 6 批)。听师傅们说可以用 pin 解决,于是先学习一下 pin...

1850
来自专栏CreateAMind

根据人类反馈进行强化学习+ 代码

https://github.com/nottombrown/rl-teacher

681
来自专栏python3

习题32:分支和函数(函数调用函数)

在很多类型的操作系统里,exit(0)表示正常退出程序,exit(1)则表示发生了错误

702
来自专栏开发之途

Gradle 常用配置总结

当项目逐渐演进的过程中,主工程依赖的 Module 可能会越来越多,此时就需要统一配置各个 Module 的编译参数了

673
来自专栏猿人谷

apue.h头文件

    最近在学习UNIX的编程,用的书是《UNIX环境高级编程》,看到书中有很有实例,我用的操作系统是RadHat,照着书把程序清单输入后编译却通不过,显示的...

1816
来自专栏FreeBuf

论如何优雅地蹭饭:克隆篡改公司饭卡(M1卡)

最近借了Proxmark3来娱乐性的玩下RFID技术,工资甚低的我只好拿公司饭卡实验,优雅地蹭几顿。物业大叔表打我啊!以下操作纯属学习目的,初学难免错误较多,望...

1795

扫码关注云+社区