Seq2Seq安装及问题解决

Windows10安装

seq2seq官网教程
需要环境:Python 2.7或Python 3.5,TensorFlow 1.0

git clone https://github.com/google/seq2seq.git
cd seq2seq
# Install package and dependencies
pip install -e .

测试

python -m unittest seq2seq.test.pipeline_test

出现问题

问题一

seq2seq/contrib/seq2seq/helper.py 报错:bernoulli,categorical 不能导入,修改helper.py:

from tensorflow.python.ops.distributions import bernoulli
from tensorflow.python.ops.distributions import categorical

问题二

AttributeError: module ‘tensorflow.contrib.tfprof’ has no attribute ‘model_analyzer’
如图:
在这里插入图片描述将TensorFlow1.2.0改为1.6.0,消失…

问题三

AttributeError: module ‘tensorflow.python.platform.flags’ has no attribute ‘_FlagValues’
解决方式:修改 seq2seq/test/pipeline_test.py 文件:
在这里插入图片描述

问题四

修改后出现PermissionError: [Errno 13] Permission denied: 'C:\Users\Computer\AppData\Local\Temp\tmph7wo8mp3’权限错误
如图:
在这里插入图片描述

Linux安装

环境

Ubuntu,TensorFlow1.6.0,python3.5

问题一

AttributeError: module ‘tensorflow.python.platform.flags’ has no attribute ‘_FlagValues’
如图:
在这里插入图片描述

问题二

ImportError: No module named ‘yaml’
用conda安装yaml失败,pip成功

pip install pyyaml

问题三

ImportError: No module named ‘matplotlib’

pip install matplotlib

猜你喜欢

转载自blog.csdn.net/qq_38879305/article/details/112275477