rockingdingo/deepnlp

TypeError: sampled_loss() got an unexpected keyword argument 'logits'

zhuermu opened this issue · 2 comments

python3.5 运行 predict 和 headline 报的异常。
Traceback (most recent call last):
File "E:\Users\gzlixiaowei\workspace2\webtest\src\textsumch\predict.py", line 171, in
tf.app.run()
File "E:\python35\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "E:\Users\gzlixiaowei\workspace2\webtest\src\textsumch\predict.py", line 153, in main
decode()
File "E:\Users\gzlixiaowei\workspace2\webtest\src\textsumch\predict.py", line 40, in decode
model = create_model(sess, True)
File "E:\Users\gzlixiaowei\workspace2\webtest\src\textsumch\headline.py", line 142, in create_model
forward_only=forward_only)
File "E:\Users\gzlixiaowei\workspace2\webtest\src\textsumch\seq2seq_model.py", line 169, in init
softmax_loss_function=softmax_loss_function)
File "E:\python35\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 1221, in model_with_buckets
softmax_loss_function=softmax_loss_function))
File "E:\python35\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 1134, in sequence_loss
softmax_loss_function=softmax_loss_function))
File "E:\python35\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 1089, in sequence_loss_by_example
crossent = softmax_loss_function(labels=target, logits=logit)

如果TensorFlow版本不是1.0.0的话,改成1.0.0再试试。

@boriwng 遇见同样问题,果然是版本的问题。换过换成1.0.0 就好了。