NVIDIA / tacotron2

Tacotron 2 - PyTorch implementation with faster-than-realtime inference
BSD 3-Clause "New" or "Revised" License
5.12k stars 1.4k forks source link

"Length of all samples has to be greater than 0" error training model on Docker provided #169

Closed Skriptotajs closed 5 years ago

Skriptotajs commented 5 years ago

When I tried to train the model on LJ Speech dataset with the default parameters, I got the fallowing error:

Saving model and optimizer state at iteration 0 to outdir/checkpoint_0 Train loss 1 37.975971 Grad Norm 20.044661 5.58s/it Train loss 2 17.680506 Grad Norm 17.836054 4.90s/it Train loss 3 10.451558 Grad Norm 16.734600 4.66s/it Traceback (most recent call last): File "train.py", line 292, in args.warm_start, args.n_gpus, args.rank, args.group_name, hparams) File "train.py", line 220, in train y_pred = model(x) File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, kwargs) File "/nvidia/tacotron2/model.py", line 516, in forward encoder_outputs = self.encoder(embedded_inputs, input_lengths) File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, *kwargs) File "/nvidia/tacotron2/model.py", line 183, in forward x, input_lengths, batch_first=True) File "/opt/conda/lib/python3.6/site-packages/torch/onnx/init.py", line 57, in wrapper return fn(args, kwargs) File "/opt/conda/lib/python3.6/site-packages/torch/nn/utils/rnn.py", line 124, in pack_padded_sequence data, batch_sizes = PackPadded.apply(input, lengths, batch_first) File "/opt/conda/lib/python3.6/site-packages/torch/nn/_functions/packing.py", line 12, in forward raise ValueError("Length of all samples has to be greater than 0, " ValueError: Length of all samples has to be greater than 0, but found an element in 'lengths' that is <= 0

bruce-willis commented 5 years ago

@Skriptotajs How have you managed to fix this? Having similar issue. Edit: I had some empty texts in the dataset, dropping these samples solved the issue

AnkurDebnath35 commented 4 years ago

I have search for empty texts and couldn't find any, but still getting the same error as a Runtime Error. Please help.

rongpenl commented 4 years ago

Check the files in filelists folder and make sure it is good.

jazz215 commented 3 years ago

I am gettng the same error on custom dataset, couldnt find ant empty text, what do you mean by empty text, in filelists, all file are format

abc.wav|text or abc.pt|text

No empty text here.

szymonpiech commented 2 years ago

thanks! I've been changing the filelists for a couple of times and apparently an error must've sneak in as indeed there was two empty lines in the .txt! It fixed the problem for me.