buriburisuri / speech-to-text-wavenet

Speech-to-Text-WaveNet : End-to-end sentence level English speech recognition based on DeepMind's WaveNet and tensorflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

train.py Error

AKBoles opened this issue · comments

Hello, after downloading VCTK corpus and moving it to asset/data, I tried to run train.py. I got the following output:

INFO:tensorflow:0307:21:29:31.864:data.py:73] VCTK corpus loaded.(total data=36395, total batch=9098)
Traceback (most recent call last):
File "train.py", line 82, in
tf.sg_train(log_interval=30, lr=0.0001, loss=loss, ep_size=data.num_batch, max_ep=20, early_stop=False)
File "/home/cc/.local/lib/python2.7/site-packages/sugartensor/sg_train.py", line 34, in sg_train
train_func(**opt)
File "/home/cc/.local/lib/python2.7/site-packages/sugartensor/sg_train.py", line 143, in wrapper
saver.restore(sess, last_file)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1345, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 717, in run
run_metadata_ptr)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 915, in _run
feed_dict_string, options, run_metadata)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 965, in _do_run
target_list, options, run_metadata)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 985, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [28] rhs shape= [1]
[[Node: save/Assign_394 = Assign[T=DT_FLOAT, _class=["loc:@layers/conv1d_18/b"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/cpu:0"](layers/conv1d_18/b/MaxProp, save/restore_slice_394)]]

Caused by op u'save/Assign_394', defined at:
File "train.py", line 82, in
tf.sg_train(log_interval=30, lr=0.0001, loss=loss, ep_size=data.num_batch, max_ep=20, early_stop=False)
File "/home/cc/.local/lib/python2.7/site-packages/sugartensor/sg_train.py", line 34, in sg_train
train_func(**opt)
File "/home/cc/.local/lib/python2.7/site-packages/sugartensor/sg_train.py", line 116, in wrapper
keep_checkpoint_every_n_hours=opt.keep_interval)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 986, in init
self.build()
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1015, in build
restore_sequentially=self._restore_sequentially)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 620, in build
restore_sequentially, reshape)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 369, in _AddRestoreOps
assign_ops.append(saveable.restore(tensors, shapes))
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 212, in restore
self.op.get_shape().is_fully_defined())
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 45, in assign
use_locking=use_locking, name=name)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 749, in apply_op
op_def=op_def)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2380, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/cc/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1298, in init
self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [28] rhs shape= [1]
[[Node: save/Assign_394 = Assign[T=DT_FLOAT, _class=["loc:@layers/conv1d_18/b"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/cpu:0"](layers/conv1d_18/b/MaxProp, save/restore_slice_394)]]

Current versions:

tensorflow - 0.11.0 sugartensor - 0.0.1.9 librosa - 0.5.0 pandas - 0.19.2

Is this a common error that I making? Will continue to explore this but thought I would post in case there was a known answer. Thanks.

If Dependencies are installed as described then it works.
Seems to brake with newer dependencies installed.
Used: pip freeze to see which version installed.
If a newer version is installed then uninstall: sudo pip uninstall sugartensor
Then install correct version: sudo pip install sugartensor==0.0.1.9
To install correct version of tensorflow: sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl

lol, this is my comment a ref would be nice? @sidh104
#49 (comment)

The correct dependencies were installed but I uninstalled and then installed once more. That seems to have worked for now! Thank you @sidh104 @EN10