-
Notifications
You must be signed in to change notification settings - Fork 4k
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
E InvalidArgumentError Not enough time for target transition sequence (required: 77, available: 76) #1629
Comments
@MuruganR96 This is something I also hit with some dataset, I have not investigated enough yet, but changing the |
https://www.tensorflow.org/api_docs/python/tf/nn/ctc_loss tf.nn.ctc_loss( The ignore_longer_outputs_than_inputs option allows to specify the behavior of the CTCLoss when dealing with sequences that have longer outputs than inputs. If true, the CTCLoss will simply return zero gradient for those items, otherwise an InvalidArgument error is returned, stopping training.now it is workingr @lissyx si. thank you r |
I had same issue, not sure why but I don't think it was the data based on the the following script giving a lower length for the text than the features :
MuruganR96's solution ignore_longer_outputs_than_inputs=True seemed to fix it! |
If you ran that script on a somewhat recent master, it could be a subtle problem: |
thanks i retried as:
and it found a file |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
#746 (comment)
in this issue and my issue almost same. @elpimous sir said,
but i tried and done to remove and replacing in my training csv file for Non ASCII, special characters and conv all lowercase but stil now throws that same error.
what can i do? how to fix this issue?///
thank you.
-Linux Ubuntu 16.04
-Name: tensorflow-gpu
Version: 1.11.0
-Python 3.6.6
-i am not installed bazel
-gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)
-CUDA 9.0 & cuDNN 7.5
-name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.43
pciBusID: 0000:01:00.0
totalMemory: 3.94GiB
python3 DeepSpeech.py --n_hidden 2048 --initialize_from_frozen_model ../models/output_graph.pb --checkpoint_dir fine_tuning_checkpoints3 --epoch 3 --train_files /home/dell/Documents/train_file1/train1.csv --dev_files /home/dell/Documents/train_file1/dev1.csv --test_files /home/dell/Documents/train_file1/test1.csv --learning_rate 0.0001 --decoder_library_path new_native_client/libctc_decoder_with_kenlm.so --alphabet_config_path data/alphabet.txt --lm_binary_path data/lm/lm.binary --lm_trie_path data/lm/trie
Preprocessing ['/home/dell/Documents/train_file1/train1.csv']
Preprocessing done
Preprocessing ['/home/dell/Documents/train_file1/dev1.csv']
Preprocessing done
Preprocessing ['/home/dell/Documents/train_file1/test1.csv']
Preprocessing done
W Parameter --validation_step needs to be >0 for early stopping to work
I Initializing from frozen model: ../models/output_graph.pb
I STARTING Optimization
I Training epoch 0...
E Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
E [[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
E [[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
E
E Caused by op 'tower_0/CTCLoss', defined at:
E File "DeepSpeech.py", line 1976, in
E tf.app.run(main)
E File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
E _sys.exit(main(argv))
E File "DeepSpeech.py", line 1932, in main
E train()
E File "DeepSpeech.py", line 1525, in train
E results_tuple, gradients, mean_edit_distance, loss = get_tower_results(model_feeder, optimizer)
E File "DeepSpeech.py", line 639, in get_tower_results
E calculate_mean_edit_distance_and_loss(model_feeder, i, dropout_rates, reuse=i>0)
E File "DeepSpeech.py", line 526, in calculate_mean_edit_distance_and_loss
E total_loss = tf.nn.ctc_loss(labels=batch_y, inputs=logits, sequence_length=batch_seq_len)
E File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/ops/ctc_ops.py", line 158, in ctc_loss
E ignore_longer_outputs_than_inputs=ignore_longer_outputs_than_inputs)
E File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/ops/gen_ctc_ops.py", line 286, in ctc_loss
E name=name)
E File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
E op_def=op_def)
E File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
E return func(*args, **kwargs)
E File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3272, in create_op
E op_def=op_def)
E File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1768, in init
E self._traceback = tf_stack.extract_stack()
E
E InvalidArgumentError (see above for traceback): Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
E [[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
E [[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
4% (1289 of 30017) |###### | Elapsed Time: 0:09:33 ETA: 4:08:28Traceback (most recent call last):
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1292, in _do_call
return fn(*args)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
[[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
[[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "DeepSpeech.py", line 1731, in train
_, current_step, batch_loss, batch_report, step_summary = session.run([train_op, global_step, loss, report_params, step_summaries_op], **extra_params)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 671, in run
run_metadata=run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 887, in run
run_metadata_ptr)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1286, in _do_run
run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
[[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
[[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
Caused by op 'tower_0/CTCLoss', defined at:
File "DeepSpeech.py", line 1976, in
tf.app.run(main)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "DeepSpeech.py", line 1932, in main
train()
File "DeepSpeech.py", line 1525, in train
results_tuple, gradients, mean_edit_distance, loss = get_tower_results(model_feeder, optimizer)
File "DeepSpeech.py", line 639, in get_tower_results
calculate_mean_edit_distance_and_loss(model_feeder, i, dropout_rates, reuse=i>0)
File "DeepSpeech.py", line 526, in calculate_mean_edit_distance_and_loss
total_loss = tf.nn.ctc_loss(labels=batch_y, inputs=logits, sequence_length=batch_seq_len)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/ops/ctc_ops.py", line 158, in ctc_loss
ignore_longer_outputs_than_inputs=ignore_longer_outputs_than_inputs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/ops/gen_ctc_ops.py", line 286, in ctc_loss
name=name)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3272, in create_op
op_def=op_def)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1768, in init
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
[[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
[[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
Traceback (most recent call last):
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1292, in _do_call
return fn(*args)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
[[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
[[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "DeepSpeech.py", line 1731, in train
_, current_step, batch_loss, batch_report, step_summary = session.run([train_op, global_step, loss, report_params, step_summaries_op], **extra_params)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 671, in run
run_metadata=run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 887, in run
run_metadata_ptr)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1286, in _do_run
run_metadata)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
[[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
[[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
Caused by op 'tower_0/CTCLoss', defined at:
File "DeepSpeech.py", line 1976, in
tf.app.run(main)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "DeepSpeech.py", line 1932, in main
train()
File "DeepSpeech.py", line 1525, in train
results_tuple, gradients, mean_edit_distance, loss = get_tower_results(model_feeder, optimizer)
File "DeepSpeech.py", line 639, in get_tower_results
calculate_mean_edit_distance_and_loss(model_feeder, i, dropout_rates, reuse=i>0)
File "DeepSpeech.py", line 526, in calculate_mean_edit_distance_and_loss
total_loss = tf.nn.ctc_loss(labels=batch_y, inputs=logits, sequence_length=batch_seq_len)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/ops/ctc_ops.py", line 158, in ctc_loss
ignore_longer_outputs_than_inputs=ignore_longer_outputs_than_inputs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/ops/gen_ctc_ops.py", line 286, in ctc_loss
name=name)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3272, in create_op
op_def=op_def)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1768, in init
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Not enough time for target transition sequence (required: 77, available: 76)0You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs
[[{{node tower_0/CTCLoss}} = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_631, tower_0/ToInt64/_633, tower_0/GatherV2, tower_0/GatherV2_DequeueMany:1)]]
[[{{node Mean_7/_673}} = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_742_Mean_7", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "DeepSpeech.py", line 1976, in
tf.app.run(main)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "DeepSpeech.py", line 1932, in main
train()
File "DeepSpeech.py", line 1770, in train
hook.end(session)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/basic_session_run_hooks.py", line 587, in end
self._save(session, last_step)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/basic_session_run_hooks.py", line 598, in _save
self._get_saver().save(session, self._save_path, global_step=step)
File "/home/dell/tmp/DeepSpeech_v0.2.0/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1421, in save
raise TypeError("'sess' must be a Session; %s" % sess)
TypeError: 'sess' must be a Session; <tensorflow.python.training.monitored_session.MonitoredSession object at 0x7faa2c1583c8>
The text was updated successfully, but these errors were encountered: