Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensorflow 0.12.1 failed to run NTM #26

Open
dfreelan opened this issue Feb 14, 2017 · 1 comment
Open

tensorflow 0.12.1 failed to run NTM #26

dfreelan opened this issue Feb 14, 2017 · 1 comment

Comments

@dfreelan
Copy link

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!

@s3xton s3xton mentioned this issue Feb 15, 2017
@camigord
Copy link

camigord commented Mar 6, 2017

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants