You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
作者好,我想问一下这个问题,如下:
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)]]
The text was updated successfully, but these errors were encountered:
作者好,我想问一下这个问题,如下:
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)]]
The text was updated successfully, but these errors were encountered: