train_tacotron2.py 는 문제가 없습니다만
train_vocoder.py 에서 다른 dataset (KSS) 을 추가하여 사용하였을때 reshape 오류가 발생하는데
sample_size 를 조정하여도 해결되지 않네요.. (only moon + son 에서는 문제없음)
이 현상은 tacotron1 repo 에서도 동일하게 발생을 합니다.
Exiting due to exception: Input to reshape is a tensor with 32 values, but the requested shape has 64
[[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]]
[[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Caused by op 'wavenet/Reshape', defined at:
File "train_vocoder.py", line 315, in
main()
File "train_vocoder.py", line 200, in main
net.add_loss(input_batch=audio_batch,local_condition=lc_batch, global_condition_batch=gc_id_batch, l2_regularization_strength=hparams.l2_regularization_strength,upsample_type=hparams.upsample_type)
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 282, in add_loss
gc_embedding = self._embed_gc(global_condition_batch) # (self.batch_size, 1, self.global_condition_channels) <--- 가운데 1은 강제로 reshape
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 233, in _embed_gc
embedding = tf.reshape(embedding,[self.batch_size, 1, self.global_condition_channels])
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6113, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 32 values, but the requested shape has 64
[[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]]
[[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Traceback (most recent call last):
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1322, in _do_call
return fn(*args)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1307, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 32 values, but the requested shape has 64
[[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]]
[[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train_vocoder.py", line 287, in main
step, lossvalue, = sess.run([global_step,net.loss, net.optimize])
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run
run_metadata)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 32 values, but the requested shape has 64
[[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]]
[[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Caused by op 'wavenet/Reshape', defined at:
File "train_vocoder.py", line 315, in
main()
File "train_vocoder.py", line 200, in main
net.add_loss(input_batch=audio_batch,local_condition=lc_batch, global_condition_batch=gc_id_batch, l2_regularization_strength=hparams.l2_regularization_strength,upsample_type=hparams.upsample_type)
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 282, in add_loss
gc_embedding = self._embed_gc(global_condition_batch) # (self.batch_size, 1, self.global_condition_channels) <--- 가운데 1은 강제로 reshape
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 233, in _embed_gc
embedding = tf.reshape(embedding,[self.batch_size, 1, self.global_condition_channels])
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6113, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 32 values, but the requested shape has 64
[[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]]
[[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
train_tacotron2.py 는 문제가 없습니다만 train_vocoder.py 에서 다른 dataset (KSS) 을 추가하여 사용하였을때 reshape 오류가 발생하는데 sample_size 를 조정하여도 해결되지 않네요.. (only moon + son 에서는 문제없음) 이 현상은 tacotron1 repo 에서도 동일하게 발생을 합니다.
Exiting due to exception: Input to reshape is a tensor with 32 values, but the requested shape has 64 [[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]] [[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Caused by op 'wavenet/Reshape', defined at: File "train_vocoder.py", line 315, in
main()
File "train_vocoder.py", line 200, in main
net.add_loss(input_batch=audio_batch,local_condition=lc_batch, global_condition_batch=gc_id_batch, l2_regularization_strength=hparams.l2_regularization_strength,upsample_type=hparams.upsample_type)
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 282, in add_loss
gc_embedding = self._embed_gc(global_condition_batch) # (self.batch_size, 1, self.global_condition_channels) <--- 가운데 1은 강제로 reshape
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 233, in _embed_gc
embedding = tf.reshape(embedding,[self.batch_size, 1, self.global_condition_channels])
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6113, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 32 values, but the requested shape has 64 [[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]] [[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Traceback (most recent call last): File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1322, in _do_call return fn(*args) File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1307, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 32 values, but the requested shape has 64 [[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]] [[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "train_vocoder.py", line 287, in main step, lossvalue, = sess.run([global_step,net.loss, net.optimize]) File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run run_metadata_ptr) File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run run_metadata) File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 32 values, but the requested shape has 64 [[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]] [[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Caused by op 'wavenet/Reshape', defined at: File "train_vocoder.py", line 315, in
main()
File "train_vocoder.py", line 200, in main
net.add_loss(input_batch=audio_batch,local_condition=lc_batch, global_condition_batch=gc_id_batch, l2_regularization_strength=hparams.l2_regularization_strength,upsample_type=hparams.upsample_type)
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 282, in add_loss
gc_embedding = self._embed_gc(global_condition_batch) # (self.batch_size, 1, self.global_condition_channels) <--- 가운데 1은 강제로 reshape
File "/root/anaconda3/sources/TTS/Tacotron2-Wavenet-Korean-TTS-master/wavenet/model.py", line 233, in _embed_gc
embedding = tf.reshape(embedding,[self.batch_size, 1, self.global_condition_channels])
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6113, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/root/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 32 values, but the requested shape has 64 [[Node: wavenet/Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](wavenet/embedding_lookup, optimizer/gradients/wavenet/dilated_stack/layer19/dilation_layer/gc_filter/conv1d/ExpandDims_grad/Shape)]] [[Node: optimizer/gradients/wavenet/postprocessing/conv1d/conv1d/Squeeze_grad/Shape/_599 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge5739...grad/Shape", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
NoneType: None Done