jaywalnut310 / vits

VITS: Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech
https://jaywalnut310.github.io/vits-demo/index.html
MIT License
6.86k stars 1.26k forks source link

getting Index error: dimension out of range (expected to be in range of [-1,0], but got got 1 #217

Closed SameerSri72 closed 3 months ago

SameerSri72 commented 3 months ago

when I run python train.py -c configs/ljs_base.json -m ljs_base after completing the necessary prerequisites, I am getting the following error: Traceback (most recent call last): File "/home/sysadm/Sameer_BDA/vits/train.py", line 290, in main() File "/home/sysadm/Sameer_BDA/vits/train.py", line 50, in main mp.spawn(run, nprocs=n_gpus, args=(n_gpus, hps,)) File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 282, in spawn return start_processes(fn, args, nprocs, join, daemon, start_method="spawn") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 238, in start_processes while not context.join(): ^^^^^^^^^^^^^^ File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 189, in join raise ProcessRaisedException(msg, error_index, failed_process.pid) torch.multiprocessing.spawn.ProcessRaisedException:

-- Process 0 terminated with the following error: Traceback (most recent call last): File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/multiprocessing/spawn.py", line 76, in _wrap fn(i, *args) File "/home/sysadm/Sameer_BDA/vits/train.py", line 117, in run train_and_evaluate(rank, epoch, hps, [net_g, net_d], [optim_g, optim_d], [scheduler_g, scheduler_d], scaler, [train_loader, eval_loader], logger, [writer, writer_eval]) File "/home/sysadm/Sameer_BDA/vits/train.py", line 137, in train_and_evaluate for batch_idx, (x, x_lengths, spec, spec_lengths, y, y_lengths) in enumerate(train_loader): File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/utils/data/dataloader.py", line 630, in next data = self._next_data() ^^^^^^^^^^^^^^^^^ File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/utils/data/dataloader.py", line 1344, in _next_data return self._process_data(data) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/utils/data/dataloader.py", line 1370, in _process_data data.reraise() File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/_utils.py", line 706, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/utils/data/_utils/worker.py", line 309, in _worker_loop data = fetcher.fetch(index) # type: ignore[possibly-undefined] ^^^^^^^^^^^^^^^^^^^^ File "/home/sysadm/miniconda3/lib/python3.11/site-packages/torch/utils/data/_utils/fetch.py", line 55, in fetch return self.collate_fn(data) ^^^^^^^^^^^^^^^^^^^^^ File "/home/sysadm/Sameer_BDA/vits/data_utils.py", line 114, in call torch.LongTensor([x[1].size(1) for x in batch]), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sysadm/Sameer_BDA/vits/data_utils.py", line 114, in torch.LongTensor([x[1].size(1) for x in batch]), ^^^^^^^^^^^^ IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)


if anybody could provide solution to this, please help.

MisterDr commented 3 months ago

Try to delete non WAV files in the DUMMY1 folder.

SameerSri72 commented 3 months ago

thanks sir, it worked.

ZodiacFRA commented 2 months ago

@MisterDr even when deleting all non wav files in the folder, some .spec.pt files are generated during the script execution, which then makes it crash, any ideas?

dhattareddy commented 3 days ago

@ZodiacFRA I am facing the same issue. Have you solved the issue? Please let me know. Even I changed the directory to save .spec.pt files.