Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Giribushan/e8933b730060a07a3f1e216aeb51286d to your computer and use it in GitHub Desktop.
Save Giribushan/e8933b730060a07a3f1e216aeb51286d to your computer and use it in GitHub Desktop.
CTC error for a wrong batch_size (expected - 2 , given - 4)
Caused by op u'CTCBeamSearchDecoder', defined at:
File "tools/export_crnn_model_script.py", line 266, in <module>
recognize(image_path=args.image_path, weights_path=args.weights_path)
File "tools/export_crnn_model_script.py", line 136, in recognize
decodes, _ = tf.nn.ctc_beam_search_decoder(inputs=net_out, sequence_length=25*np.ones(4), merge_repeated=False)
File "/home/sathish/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/ctc_ops.py", line 277, in ctc_beam_search_decoder
merge_repeated=merge_repeated))
File "/home/sathish/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_ctc_ops.py", line 73, in ctc_beam_search_decoder
top_paths=top_paths, merge_repeated=merge_repeated, name=name)
File "/home/sathish/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/sathish/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/home/sathish/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1718, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
FailedPreconditionError (see above for traceback): len(sequence_length) != batch_size. len(sequence_length): 4 batch_size: 2
[[Node: CTCBeamSearchDecoder = CTCBeamSearchDecoder[beam_width=100, merge_repeated=false, top_paths=1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](shadow/Print, CTCBeamSearchDecoder/sequence_length)]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment