I am seeing this error:
Argument #4: Padding size should be less than the corresponding input dimension, but got: padding (512, 512) at dimension 3 of input [1, 1, 1, 220]
after trying to train using this command:
python train.py --output_directory=outdir --log_directory=logdir
I am using pytorch 1.0 and python 3.6 with a single Tesla V100 gpu and I am using my own data set which I processed to be identical to the LJSpeech format and have changed the filelists accordingly.
The full log is:
FP16 Run: False
Dynamic Loss Scaling: True
Distributed Run: False
cuDNN Enabled: True
cuDNN Benchmark: False
Epoch: 0
Train loss 0 28.056627 Grad Norm 7.857424 5.01s/it
Traceback (most recent call last):
File "train.py", line 284, in <module>
args.warm_start, args.n_gpus, args.rank, args.group_name, hparams)
File "train.py", line 242, in train
hparams.distributed_run, rank)
File "train.py", line 133, in validate
for i, batch in enumerate(val_loader):
File "/home/mahdeto/anaconda2/envs/tacotron2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 637, in __next__
return self._process_next_batch(batch)
File "/home/mahdeto/anaconda2/envs/tacotron2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File "/home/mahdeto/anaconda2/envs/tacotron2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/mahdeto/anaconda2/envs/tacotron2/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in <listcomp>
samples = collate_fn([dataset[i] for i in batch_indices])
File "/raid1/mahdeto/repo/tacotron2/data_utils.py", line 61, in __getitem__
return self.get_mel_text_pair(self.audiopaths_and_text[index])
File "/raid1/mahdeto/repo/tacotron2/data_utils.py", line 34, in get_mel_text_pair
mel = self.get_mel(audiopath)
File "/raid1/mahdeto/repo/tacotron2/data_utils.py", line 46, in get_mel
melspec = self.stft.mel_spectrogram(audio_norm)
File "/raid1/mahdeto/repo/tacotron2/layers.py", line 76, in mel_spectrogram
magnitudes, phases = self.stft_fn.transform(y)
File "/raid1/mahdeto/repo/tacotron2/stft.py", line 88, in transform
mode='reflect')
File "/home/mahdeto/anaconda2/envs/tacotron2/lib/python3.6/site-packages/torch/nn/functional.py", line 2685, in pad
ret = torch._C._nn.reflection_pad2d(input, pad)
RuntimeError: Argument #4: Padding size should be less than the corresponding input dimension, but got: padding (512, 512) at dimension 3 of input [1, 1, 1, 220]
Please help. Thanks!
In case someone runs into this. Turns out I had some corrupted wav files (very small but had some speech) that caused this.
Additionally this case is possible, when the wav file is a stereo, not mono. Tacotron is using 16kHz 16bit mono for training.
I had the same problem,now.
Codec:PCM S16LE(s16l)
Type:Audio
Channels:Mono
Sample rate:16000Hz
Bits per sample:16
Maybe is a codec problem,Above info is obtained from VLC,anyone can inform us the working setup?
Quite confusing,I also edited the hparam file respectively does not seem to work.
Originally 22khz,now 16kHz 16bit mono for training.
Does not seems to work.hmmmm..
Oh thanks i also suspected those weird small files it is not corrupted but,something is wrong when used as input.Solved.THANKS.
Most helpful comment
In case someone runs into this. Turns out I had some corrupted wav files (very small but had some speech) that caused this.