NTM-tensorflow
NTM-tensorflow copied to clipboard
tensorflow 0.12.1 failed to run NTM
Below I show I have verified I have tensorflow 0.12.1, and the error trying to run the copy task.
VSs-MacBook-Pro-5:NTM-tensorflow dfreelan$ python3 -c 'import tensorflow as tf; print(tf.__version__)'
0.12.1
VSs-MacBook-Pro-5:NTM-tensorflow dfreelan$ python3 main.py --task copy --is_train True
Traceback (most recent call last):
File "main.py", line 6, in <module>
from ntm import NTM
File "/Users/dfreelan/dev/NTM-tensorflow/ntm.py", line 8, in <module>
from tensorflow.contrib.legacy_seq2seq import sequence_loss
ImportError: No module named 'tensorflow.contrib.legacy_seq2seq'
Any help trying to resolve this issue would be appreciated!
Hi, for anyone having the same problem with tf version 0.12.1, change the line
from tensorflow.contrib.legacy_seq2seq import sequence_loss
for:
from tensorflow.python.ops.seq2seq import sequence_loss
You may also run into another problem with the function softmax_loss_function (in ntm.py) which calls tf.nn.sigmoid_cross_entropy_with_logits. The name of the parameters have changed, you can modify the function to return:
return tf.nn.sigmoid_cross_entropy_with_logits(targets=labels, logits=inputs)