heatz123/naturalspeech

IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

Closed this issue · 2 comments

Hello @heatz123
When I am running the preprocess_durations.py for LJSpeech Dataset. I am getting this error:

File "preprocess_durations.py", line 219, in <module>
    for batch_idx, (
  File "/root/bits/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__
    data = self._next_data()
  File "/root/bits/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 677, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/root/bits/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch
    return self.collate_fn(data)
  File "preprocess_durations.py", line 135, in __call__
    torch.LongTensor([x[1].size(1) for x in batch]), dim=0, descending=True
  File "preprocess_durations.py", line 135, in <listcomp>
    torch.LongTensor([x[1].size(1) for x in batch]), dim=0, descending=True
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

See the relevant issue here: jaywalnut310/vits#135

Thank You @remy-radix. It worked.