第4步训练时报错
stiger104 opened this issue · comments
执行 ./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'
似乎在新版本的tensorflow
把LSTM
的位置从tf.nn.rnn_cell.BasicLSTMCell
改到了tf.contrib.rnn.BasicLSTMCell
回头我试试
已解决,使用0.12版的tensor是可以的,新版的1.0不兼容。另外,CPU上训练速度极慢,给个数据:20核心,64GB, 一个epoch要7个小时以上,CPU上基本就训练不出来的
训练的话还是gpu吧~~