qhduan / Seq2Seq_Chatbot_QA

使用TensorFlow实现的Sequence to Sequence的聊天机器人模型
793 stars 275 forks source link

第4步训练时报错 #5

Closed stiger104 closed 7 years ago

stiger104 commented 7 years ago

执行 ./train_model.sh 时报错,请问是什么原因呢?

Traceback (most recent call last): File "s2s.py", line 324, in tf.app.run() File "/var/lib/hadoop-hdfs/.venvs/py3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "s2s.py", line 319, in main train() File "s2s.py", line 129, in train model = create_model(sess, False) File "s2s.py", line 110, in create_model dtype File "/var/lib/hadoop-hdfs/zhuangxuekun/research/Seq2Seq_Chatbot_QA/s2s_model.py", line 31, in init cell = tf.nn.rnn_cell.BasicLSTMCell(size) AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'rnn_cell'

qhduan commented 7 years ago

似乎在新版本的tensorflowLSTM的位置从tf.nn.rnn_cell.BasicLSTMCell改到了tf.contrib.rnn.BasicLSTMCell

回头我试试

stiger104 commented 7 years ago

已解决,使用0.12版的tensor是可以的,新版的1.0不兼容。另外,CPU上训练速度极慢,给个数据:20核心,64GB, 一个epoch要7个小时以上,CPU上基本就训练不出来的

qhduan commented 7 years ago

训练的话还是gpu吧~~