-
Notifications
You must be signed in to change notification settings - Fork 3
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
dataset patch error #1
Comments
@naktinis can you help to see this issue? thanks in advance! |
@superhg2012 the respository is not actively maintained. If you paste here the exact commands you executed when you got this error, I may try to replicate it when I have time. |
@naktinis python main.py --model-dir /data0/cnn_models --model cnn --image-dir /data0/vox_pngs/ --train-set /data0/vox_pngs/train-set.csv --eval-set /data0/vox_pngs/eval-set.csv the problem seems caused by this tuple ( {'sgam' : features}, labels): there are two code snaps in the project. 1 dataset.py
2 main.py
when I modify {'sgram': next_example}, next_label to next_example, next_label and {'sgram': image_data}, label to image_data, label the train process can run without problem. I do not know why. Another question: the spectrogram_width is set to 858, pngs are generated from audios which is ? X 128 in size. ? is different for audios with different duration. So some pngs is less than 858 in width, so when train cnn model, these pngs will fail since cnn require fixed filter size. I see that the tensorflow dataset Api is used to padding batch to same size, Is this is used to process the pngs whose spectrogram_width is less than 858? if not, how can I deal with those small pngs? |
When run with predict, another exception throws: tensorflow.python.framework.errors_impl.InvalidArgumentError: Index out of range using input dim 3; input has only 3 dims for 'strided_slice_2' (op: 'StridedSlice') with input shapes: [?,?,?], [4], [4], [4] and with computed input tensors: input[3] = <1 1 1 1>. |
Hi, an error thrown when run train, could you help to see this problem?
Traceback (most recent call last):
File "main.py", line 414, in
tf.app.run(main=train_or_predict)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 405, in train_or_predict
hparams=params,
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 218, in run
return _execute_schedule(experiment, schedule)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 46, in _execute_schedule
return task()
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 625, in train_and_evaluate
self.train(delay_secs=0)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 367, in train
hooks=self._train_monitors + extra_hooks)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 807, in _call_train
hooks=hooks)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 302, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 708, in _train_model
input_fn, model_fn_lib.ModeKeys.TRAIN)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 577, in _get_features_and_labels_from_input_fn
result = self._call_input_fn(input_fn, mode)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 663, in _call_input_fn
return input_fn(**kwargs)
File "main.py", line 218, in input_fn
padded_shapes=([None, None, None],[])
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 695, in padded_batch
return PaddedBatchDataset(self, batch_size, padded_shapes, padding_values)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 1292, in init
input_dataset.output_shapes, _partial_shape_to_tensor, padded_shapes)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/util/nest.py", line 512, in map_structure_up_to
assert_shallow_structure(shallow_tree, input_tree)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/util/nest.py", line 372, in assert_shallow_structure
check_types=check_types)
File "/data0/anaconda3/lib/python3.6/site-packages/tensorflow/python/data/util/nest.py", line 356, in assert_shallow_structure
"Input has type: %s." % type(input_tree))
TypeError: If shallow structure is a sequence, input must also be a sequence. Input has type: <class 'list'>.
The text was updated successfully, but these errors were encountered: