ctc_loss longer than input

This commit is contained in:
JRMeyer 2018-12-12 05:27:58 +03:00 committed by josh
parent 9dfc40f53d
commit 705b70b495

View File

@ -117,7 +117,8 @@ def evaluate(test_data, inference_graph, alphabet):
sparse_labels = tf.cast(ctc_label_dense_to_sparse(labels_ph, label_lengths_ph, FLAGS.test_batch_size), tf.int32)
loss = tf.nn.ctc_loss(labels=sparse_labels,
inputs=layers['raw_logits'],
sequence_length=inputs['input_lengths'])
sequence_length=inputs['input_lengths'],
ignore_longer_outputs_than_inputs=True)
# Create a saver using variables from the above newly created graph
mapping = {v.op.name: v for v in tf.global_variables() if not v.op.name.startswith('previous_state_')}