Automatic_Speech_Recognition icon indicating copy to clipboard operation
Automatic_Speech_Recognition copied to clipboard

error when running libri_train

Open njuzrs opened this issue 7 years ago • 4 comments

Hello, when I run the libri_train code based on processed librispeech dataset, it apper followed error:

Initializing Epoch 1 ... Traceback (most recent call last): File "libri_train.py", line 281, in runner.run() File "libri_train.py", line 216, in run feed_dict=feedDict) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 778, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 961, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (1720, 64, 39) for Tensor u'Placeholder:0', which has shape '(1720, 64, 60)'

It seems phoneme mapping problem, How can I solve the problem? Thanks for answering.

njuzrs avatar Jun 10 '17 08:06 njuzrs

@njuzrs You should change the feature size parameter, since your dataset's feature vector length is 39, but the code is 60. So you should change 60 to 39.

zzw922cn avatar Jun 11 '17 03:06 zzw922cn

@zzw922cn Thanks, it works. I run the experiment for 6 epochs and training error rate is up to 0.57. But it seems not working good in test dataset. Could you tell me how many epochs is appropriate according to your experience?

njuzrs avatar Jun 11 '17 05:06 njuzrs

@njuzrs probably several tens epochs, if set lr to be 0.0001

zzw922cn avatar Jun 26 '17 00:06 zzw922cn

Hi!, I faced the error when run libri:

FailedPreconditionError (see above for traceback): Attempting to use uninitialized value DBRNN_1/fw/basic_lstm_cell/biases [[Node: DBRNN_1/fw/basic_lstm_cell/biases/read = IdentityT=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

I don't know how to fix, plz help me

Here is full message:

dev mode... load_data... load_data in 49.6368458271 s build_graph... build_graph in 24.0902910233 s dir id:0 load_data... load_data in 3.88050508499 s build_graph... build_graph in 28.0377850533 s count_params... number of trainable parameters: 1664285 count_params in 0.00016713142395 s count_params... number of all parameters: 1664285 count_params in 9.79900360107e-05 s {'rnncell': <class 'tensorflow.contrib.rnn.python.ops.core_rnn_cell_impl.BasicLSTMCell'>, 'optimizer': <class 'tensorflow.python.training.adam.AdamOptimizer'>, 'num_hidden': 256, 'activation': <function tanh at 0x7f44de827de8>, 'all params': 1664285, 'num_class': 29, 'name': None, 'learning rate': 0.0001, 'keep prob': 0.9, 'trainable params': 1664285, 'num_layer': 2, 'batch size': 10} 2017-10-09 10:24:27.585390: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-10-09 10:24:27.601400: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-10-09 10:24:27.601452: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-10-09 10:24:27.601474: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-10-09 10:24:27.601493: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. Traceback (most recent call last): File "libri_train.py", line 284, in runner.run() File "libri_train.py", line 227, in run model.targetY, model.errorRate], feed_dict=feedDict) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 778, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 982, in _run feed_dict_string, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1032, in _do_run target_list, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1052, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value DBRNN_1/fw/basic_lstm_cell/biases [[Node: DBRNN_1/fw/basic_lstm_cell/biases/read = IdentityT=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

Caused by op u'DBRNN_1/fw/basic_lstm_cell/biases/read', defined at: File "libri_train.py", line 284, in runner.run() File "libri_train.py", line 182, in run model = model_fn(args, maxTimeSteps) File "/home/ta/ASR/Automatic_Speech_Recognition/models/dynamic_brnn.py", line 111, in init self.build_graph(args, maxTimeSteps) File "/home/ta/ASR/Automatic_Speech_Recognition/utils/utils.py", line 32, in wrapper result = func(*args, **kwargs) File "/home/ta/ASR/Automatic_Speech_Recognition/models/dynamic_brnn.py", line 138, in build_graph fbHrs = build_multi_dynamic_brnn(self.args, maxTimeSteps, self.inputX, self.cell_fn, self.seqLengths) File "/home/ta/ASR/Automatic_Speech_Recognition/models/dynamic_brnn.py", line 65, in build_multi_dynamic_brnn scope=scope) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 350, in bidirectional_dynamic_rnn time_major=time_major, scope=fw_scope) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 553, in dynamic_rnn dtype=dtype) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 720, in _dynamic_rnn_loop swap_memory=swap_memory) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2623, in while_loop result = context.BuildLoop(cond, body, loop_vars, shape_invariants) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2456, in BuildLoop pred, body, original_loop_vars, loop_vars, shape_invariants) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2406, in _BuildLoop body_result = body(*packed_vars_for_body) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 703, in _time_step skip_conditionals=True) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 177, in _rnn_step new_output, new_state = call_cell() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.py", line 691, in call_cell = lambda: cell(input_t, state) File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 241, in call concat = _linear([inputs, h], 4 * self._num_units, True) File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 1056, in _linear initializer=init_ops.constant_initializer(bias_start, dtype=dtype)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 1049, in get_variable use_resource=use_resource, custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 948, in get_variable use_resource=use_resource, custom_getter=custom_getter) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 356, in get_variable validate_shape=validate_shape, use_resource=use_resource) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 341, in _true_getter use_resource=use_resource) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 714, in _get_single_variable validate_shape=validate_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variables.py", line 197, in init expected_shape=expected_shape) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variables.py", line 313, in _init_from_args self._snapshot = array_ops.identity(self._variable, name="read") File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_array_ops.py", line 1338, in identity result = _op_def_lib.apply_op("Identity", input=input, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2336, in create_op original_op=self._default_original_op, op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1228, in init self._traceback = _extract_stack()

FailedPreconditionError (see above for traceback): Attempting to use uninitialized value DBRNN_1/fw/basic_lstm_cell/biases [[Node: DBRNN_1/fw/basic_lstm_cell/biases/read = IdentityT=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

holianh avatar Oct 09 '17 02:10 holianh