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

TypeError: softmax_loss_function() got an unexpected keyword argument 'logits' #32

Open
machuck opened this issue Jul 14, 2017 · 1 comment

Comments

@machuck
Copy link

machuck commented Jul 14, 2017

After running 2to3 -w on all the .py files, I got an error using python3.4 running the first example in the readme (train):

[] Building a NTM model
Percent: [####################] 100.00% Finished.
[
] Build a NTM model finished
[*] Reading checkpoints...
Traceback (most recent call last):
File "main.py", line 72, in
tf.app.run()
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 62, in main
task.run(ntm, int(FLAGS.test_max_length * 1 / 3), sess)
File "/home/can/NTM-tensorflow/tasks/copy.py", line 35, in run
[ntm.get_loss(seq_length)],
File "/home/can/NTM-tensorflow/ntm.py", line 206, in get_loss
softmax_loss_function=softmax_loss_function)
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1134, in sequence_loss
softmax_loss_function=softmax_loss_function))
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1089, in sequence_loss_by_example
crossent = softmax_loss_function(labels=target, logits=logit)
TypeError: softmax_loss_function() got an unexpected keyword argument 'logits'

@fshamshirdar
Copy link

I've got the same error with Tensorflow 1.2.1. But as mentioned in Prerequisites section, it works with Tensorflow 1.1.0

This specific error can be fixed by simply changing softmax_loss_function(labels, inputs) to softmax_loss_function(labels, logits) in ntm.py#L15, but further errors might be raised regarding tensorflow version changes.

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