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

InvalidArgumentError #9

Open
TyrionChou opened this issue Jun 16, 2019 · 1 comment
Open

InvalidArgumentError #9

TyrionChou opened this issue Jun 16, 2019 · 1 comment

Comments

@TyrionChou
Copy link

作者好,我想问一下这个问题,如下:
Caused by op u'attention_decoder/train_loss/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits', defined at:
File "train.py", line 171, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "train.py", line 74, in main
image_placeholder, groundtruth_text_placeholder, FLAGS.single_seq)
File "/root/WTR/AON_zh/model_aon.py", line 334, in inference
train_output_dict, pred_output_dict, train_logits, train_target = _attention_based_decoder(encoded_sequence, groundtruth_text)
File "/root/WTR/AON_zh/model_aon.py", line 294, in _attention_based_decoder
name='train_loss'
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/seq2seq/python/ops/loss.py", line 92, in sequence_loss
labels=targets, logits=logits_flat)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 2050, in sparse_softmax_cross_entropy_with_logits
precise_logits, labels, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 7479, in sparse_softmax_cross_entropy_with_logits
labels=labels, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): logits and labels must have the same first dimension, got logits shape [3200,3258] and labels shape [3424]
[[Node: attention_decoder/train_loss/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT64, _device="/job:localhost/replica:0/task:0/device:GPU:0"](attention_decoder/train_loss/Reshape, attention_decoder/train_loss/Reshape_1)]]

@TyrionChou
Copy link
Author

这个问题出现在训练到1000步的时候,之前都可以训练,每训练到1000步就会出现这个问题!

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

1 participant