Tacotron2: Train Fails with error: shape '[1, 1, 38514]' is invalid for input of size 77028

Created on 13 Jan 2019  路  3Comments  路  Source: NVIDIA/tacotron2

Trying to train with WAV files with sample rate 22050 (same as LJSpeech) on my own dataset that is identical to LJspeech dataset, the dataloader fails to load the wav file. I didn't change anything in haparams.py but only the batch size.

Is there anything to change to WAV files to match LJspeech wav files? Or the issue is something else

Can you help please ?

RuntimeError: Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\envs\tensorflow\lib\site-packages\torch\utils\data\dataloader.py", line 138, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\envs\tensorflow\lib\site-packages\torch\utils\data\dataloader.py", line 138, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "F:\src\tacotron2\data_utils.py", line 62, in __getitem__
    return self.get_mel_text_pair(self.audiopaths_and_text[index])
  File "F:\src\tacotron2\data_utils.py", line 34, in get_mel_text_pair
    mel = self.get_mel(audiopath)
  File "F:\src\tacotron2\data_utils.py", line 47, in get_mel
    melspec = self.stft.mel_spectrogram(audio_norm)
  File "F:\src\tacotron2\layers.py", line 76, in mel_spectrogram
    magnitudes, phases = self.stft_fn.transform(y)
  File "F:\src\tacotron2\stft.py", line 84, in transform
    input_data = input_data.view(num_batches, 1, num_samples)
RuntimeError: shape '[1, 1, 38514]' is invalid for input of size 77028

Most helpful comment

Turns out that my WAV files were 2 channels. Converting to single channel fixed the issue.

All 3 comments

Turns out that my WAV files were 2 channels. Converting to single channel fixed the issue.

Turns out that my WAV files were 2 channels. Converting to single channel fixed the issue.

Hi,
Can you please explain how you converted it to single channel?
thanks!

Turns out that my WAV files were 2 channels. Converting to single channel fixed the issue.

Hi,
Can you please explain how you converted it to single channel?
thanks!

You can try it
https://stackoverflow.com/questions/5120555/how-can-i-convert-a-wav-from-stereo-to-mono-in-python

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NewEricWang picture NewEricWang  路  5Comments

xDuck picture xDuck  路  4Comments

Jiff-Zhang picture Jiff-Zhang  路  7Comments

hadaev8 picture hadaev8  路  4Comments

shoegazerstella picture shoegazerstella  路  8Comments