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

E InvalidArgumentError Not enough time for target transition sequence (required: 77, available: 76) #1629

Closed
MuruganR96 opened this issue Oct 5, 2018 · 6 comments

Comments

@MuruganR96
Copy link

#746 (comment)

in this issue and my issue almost same. @elpimous sir said,

I think that non ascii will be hard to integrate..(I'll try)
without any special charachers, It works.

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>

@MuruganR96 MuruganR96 changed the title E InvalidArgumentError (see above for traceback): Not enough time for target transition sequence (required: 77, available: E InvalidArgumentError Not enough time for target transition sequence (required: 77, available: 76) Oct 5, 2018
@lissyx
Copy link
Collaborator

lissyx commented Oct 5, 2018

@MuruganR96 This is something I also hit with some dataset, I have not investigated enough yet, but changing the ctc_loss call in DeepSpeech.py by adding ignore_longer_outputs_than_inputs=True worked for me

@MuruganR96
Copy link
Author

MuruganR96 commented Oct 7, 2018

https://www.tensorflow.org/api_docs/python/tf/nn/ctc_loss

tf.nn.ctc_loss(
labels,
inputs,
sequence_length,
preprocess_collapse_repeated=False,
ctc_merge_repeated=True,
ignore_longer_outputs_than_inputs=True,
time_major=True
)

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

@robmsmt
Copy link
Contributor

robmsmt commented Nov 8, 2018

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 :


import pandas as pd
from util.audio import audiofile_to_input_vector

df = pd.read_csv('/fast/ls_data/3ft_recording/csvs/TRAIN_3ft-875b59bf-18b7-4156-a888-654515ca077d_xform.csv')

def aftiv(row):
    return audiofile_to_input_vector(row['wav_filename'], 26, 9)

def aftiv_length(row):
    return row['aftiv'].shape[0]

def trans_length(row):
    return len(row['transcript'])

df['aftiv'] = df.apply(aftiv, axis=1)
df['aftiv_len'] = df.apply(aftiv_length, axis=1)
df['trans_len'] = df.apply(trans_length, axis=1)
df['good_flag'] = df.aftiv_len > df.trans_len

MuruganR96's solution ignore_longer_outputs_than_inputs=True seemed to fix it!

@reuben
Copy link
Contributor

reuben commented Nov 8, 2018

If you ran that script on a somewhat recent master, it could be a subtle problem: audiofile_to_input_vector no longer does the context windowing it used to do, it's now been moved to its callers. This means audiofile_to_input_vector(...).shape[0] is not the actual shape that gets fed to the acoustic model, you need to subtract the two empty context windows added to the beginning and end of the feature array, so it should be audiofile_to_input_vector(...).shape[0] - 2*n_context.

@robmsmt
Copy link
Contributor

robmsmt commented Nov 8, 2018

thanks i retried as:

import pandas as pd
from util.audio import audiofile_to_input_vector
N_CONTEXT = 9

df = pd.read_csv('/fast/ls_data/3ft_recording/csvs/TRAIN_3ft-875b59bf-18b7-4156-a888-654515ca077d_xform.csv')

def aftiv_length(row):
    return audiofile_to_input_vector(row['wav_filename'], 26, N_CONTEXT).shape[0] - 2*N_CONTEXT

def trans_length(row):
    return len(row['transcript'])

df['aftiv_len'] = df.apply(aftiv_length, axis=1)
df['trans_len'] = df.apply(trans_length, axis=1)
df['good_flag'] = df.aftiv_len > df.trans_len

and it found a file

@lock
Copy link

lock bot commented Jan 2, 2019

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.

@lock lock bot locked and limited conversation to collaborators Jan 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants