However, it prints only 0 and shows the following error:
0
Traceback (most recent call last):
File "main_audio.py", line 153, in <module>
for batch_idx, batch in enumerate(training_data_loader):
File "/mnt/home/20140941/.conda/envs/opt_anaconda/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 281, in __next__
return self._process_next_batch(batch)
File "/mnt/home/20140941/.conda/envs/opt_anaconda/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/mnt/home/20140941/.conda/envs/opt_anaconda/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "build/bdist.linux-x86_64/egg/torchaudio/datasets/vctk.py", line 126, in __getitem__
audio, target = self.data[index], self.labels[index]
IndexError: tuple index out of range
I assume you are using the torchaudio library. The root should be a folder not a file. Otherwise, you’ll have to make a custom torch.utils.data.Dataset. Also, did you check to see that it actually downloads the files? The VCTK dataset is very large and takes a long time to download. You should probably just run the first line in a REPL and see if the dataset gets downloaded correctly.
The length of training set is 44257. When I run code it prints integers from 1 to 20 (supposed to print to 22129). And shows similar errror.
for batch_idx, batch in enumerate(training_data_loader, 0):
File "/mnt/home/20140941/.conda/envs/opt_anaconda/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 281, in __next__
return self._process_next_batch(batch)
File "/mnt/home/20140941/.conda/envs/opt_anaconda/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/mnt/home/20140941/.conda/envs/opt_anaconda/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "build/bdist.linux-x86_64/egg/torchaudio/datasets/vctk.py", line 126, in __getitem__
audio, target = self.data[index], self.labels[index]
IndexError: tuple index out of range