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

关于跑代码时候发生 Type mismatch 的异常 #4

Closed
wuyx517 opened this issue Jul 12, 2021 · 2 comments
Closed

关于跑代码时候发生 Type mismatch 的异常 #4

wuyx517 opened this issue Jul 12, 2021 · 2 comments

Comments

@wuyx517
Copy link

wuyx517 commented Jul 12, 2021

在运行 preprocess.py 这步时出现异常

Traceback (most recent call last):
File "train.py", line 329, in
main()
File "train.py", line 257, in main
for fids, texts, mels, t_lengths, m_lengths in train_set.take(1):
File "/home/wuyx/miniconda3/envs/vc/lib/python3.6/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 761, in next
return self._next_internal()
File "/home/wuyx/miniconda3/envs/vc/lib/python3.6/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 747, in _next_internal
output_shapes=self._flat_output_shapes)
File "/home/wuyx/miniconda3/envs/vc/lib/python3.6/site-packages/tensorflow/python/ops/gen_dataset_ops.py", line 2728, in iterator_get_next
_ops.raise_from_not_ok_status(e, name)
File "/home/wuyx/miniconda3/envs/vc/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 6897, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File "", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: Type mismatch between parsed tensor (float) and dtype (double)
[[{{node ParseTensor_1}}]] [Op:IteratorGetNext]

@light1726
Copy link
Member

Hi @wuyx517! Could you check the data type of your extracted Mel-spectrogram, by default they are under the ./ljspeech/mels/ directory and should be of float64 data type if you follow the provided environment settings.

If yours are of float32 data type, then try to change float64 in this line to float32 and see if your problem could be solved.

@wuyx517
Copy link
Author

wuyx517 commented Jul 12, 2021

Thank you @light1726 !I use Databaker's data set. So when extracting the Mel-spectorgram stage, the data is float32. I changed the code in mels = self.audio_processor.melspectrogram(wav_arr) (./datasets/datasets.py line 154) to mels = self.audio_processor.melspectrogram(wav_arr).astype('float64') and regenerated Mel, which solved the problem. Thank you very much for helping me solve the problem.

@wuyx517 wuyx517 closed this as completed Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants