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

Problem in changing sample rate into 16k Hz #35

Open
xuexidi opened this issue Nov 16, 2020 · 3 comments
Open

Problem in changing sample rate into 16k Hz #35

xuexidi opened this issue Nov 16, 2020 · 3 comments

Comments

@xuexidi
Copy link

xuexidi commented Nov 16, 2020

Hi! Thanks for your code!

When I train the model in the sample rate of 22.05k Hz,and keep the other params the same with your given params. Every thing goes well.

But,when I tried to modified the sample rate to 16k Hz
the configration is:

sr:16k Hz
n_fft:800
hop_legth:200
win_length:800

when I started trainning, I got this warning:
train.py:187: UserWarning: Using a target size (torch.Size([64, 80, 51])) that is different to the input size (torch.Size([64, 80, 40])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.

And an error occured:
Traceback (most recent call last):
File "train.py", line 284, in
train_melgan()
File "train.py", line 187, in train_melgan
s_error = F.l1_loss(s_t, s_pred_t).item()
File "/home/pxdevice/anaconda3/envs/oneshot/lib/python3.6/site-packages/torch/nn/functional.py", line 2616, in l1_loss
expanded_input, expanded_target = torch.broadcast_tensors(input, target)
File "/home/pxdevice/anaconda3/envs/oneshot/lib/python3.6/site-packages/torch/functional.py", line 65, in broadcast_tensors
return _VF.broadcast_tensors(tensors)
RuntimeError: The size of tensor a (40) must match the size of tensor b (51) at non-singleton dimension 2

I have no idea to fix this error,should I modify the structure params of Generator network? Could you please help me, please!

@allenhung1025
Copy link

Hi,
you can make target and input last dimension(dim=2) the same size

@RussellSB
Copy link

RussellSB commented Apr 17, 2021

Hi,
you can make target and input last dimension(dim=2) the same size

@allenhung1025 Where is this adjustment required to be made? I'm experiencing the same issue

@allenhung1025
Copy link

@RussellSB Hi, for Example, if the target size is (torch.Size([64, 80, 51])) and the input size is (torch.Size([64, 80, 40])), you can compute loss between target[:, :, :40] and input.

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

No branches or pull requests

3 participants