Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: Dimension out of range #27

Open
beanels01 opened this issue Jul 18, 2023 · 1 comment
Open

IndexError: Dimension out of range #27

beanels01 opened this issue Jul 18, 2023 · 1 comment

Comments

@beanels01
Copy link

beanels01 commented Jul 18, 2023

所有依賴已正確安裝

運行
python preprocess.py --text_index 2 --filelists filelists/train.txt filelists/val.txt --text_cleaners chinese_cleaners
python emotion_extract.py --filelists filelists/train.txt filelists/val.txt
均無問題

在實際上train的時候報錯
python train_ms.py -c configs/test.json -m test

File "G:\emotional-vits\data_utils.py", line 264, in <listcomp>
    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)

嘗試依照ChatGpt建議添加
for i, x in enumerate(batch):
if len(x[1].shape) < 2:
print(f"Item {i} in batch has unexpected shape {x[1].shape}")
得到大量輸出

Item 1 in batch has unexpected shape torch.Size([513])
Item 2 in batch has unexpected shape torch.Size([513])
Item 3 in batch has unexpected shape torch.Size([513])
Item 4 in batch has unexpected shape torch.Size([513])
Item 5 in batch has unexpected shape torch.Size([513])
Item 6 in batch has unexpected shape torch.Size([513])
Item 7 in batch has unexpected shape torch.Size([513])
Item 8 in batch has unexpected shape torch.Size([513])
Item 9 in batch has unexpected shape torch.Size([513])
Item 10 in batch has unexpected shape torch.Size([513])
Item 11 in batch has unexpected shape torch.Size([513])
Item 12 in batch has unexpected shape torch.Size([513])
Item 13 in batch has unexpected shape torch.Size([513])
Item 14 in batch has unexpected shape torch.Size([513])
Item 15 in batch has unexpected shape torch.Size([513])
Item 16 in batch has unexpected shape torch.Size([513])
Item 17 in batch has unexpected shape torch.Size([513])
Item 18 in batch has unexpected shape torch.Size([513])
Item 19 in batch has unexpected shape torch.Size([513])
Item 20 in batch has unexpected shape torch.Size([513])
Item 21 in batch has unexpected shape torch.Size([513])
Item 22 in batch has unexpected shape torch.Size([513])
Item 23 in batch has unexpected shape torch.Size([513])```
@woaki
Copy link

woaki commented Nov 13, 2023

pytorch 版本的问题。有两种解决办法
1、将torch版本降到 1.6
2、修改代码
image
(ps:记得将已经wavs文件夹内已经生成的*.spec.pt文件全部删除)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants