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

Tensorshape mismatch error when Postnet starts #8

Open
SupreethRao99 opened this issue Aug 16, 2022 · 2 comments
Open

Tensorshape mismatch error when Postnet starts #8

SupreethRao99 opened this issue Aug 16, 2022 · 2 comments

Comments

@SupreethRao99
Copy link

Hello, I've been trying to train a model and when postnet starts I run into the following issue

Traceback (most recent call last):
  File "train.py", line 300, in <module>
    main()
  File "train.py", line 296, in main
    train(0, args, hp, hp_str)
  File "train.py", line 169, in train
    sc_loss_, mag_loss_ = stft_loss(y_g_hat[:, :, :y.size(2)].squeeze(1), y.squeeze(1))
  File "/home/guest/Supreeth/hifigan-denoiser/hifigan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/guest/Supreeth/hifigan-denoiser/stft_loss.py", line 130, in forward
    sc_l, mag_l = f(x, y)
  File "/home/guest/Supreeth/hifigan-denoiser/hifigan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/guest/Supreeth/hifigan-denoiser/stft_loss.py", line 91, in forward
    sc_loss = self.spectral_convergenge_loss(x_mag, y_mag)
  File "/home/guest/Supreeth/hifigan-denoiser/hifigan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/guest/Supreeth/hifigan-denoiser/stft_loss.py", line 46, in forward
    return torch.norm(y_mag - x_mag, p="fro") / torch.norm(y_mag, p="fro")
RuntimeError: The size of tensor a (641) must match the size of tensor b (640) at non-singleton dimension 1

Is there a fix for this? thank you!

@PengyvWANG
Copy link

Hi, did you solve this problem? I also face the same Error

@coreeey
Copy link

coreeey commented Sep 20, 2023

Hi, did you solve this problem? I also face the same Error

Hello, I've been trying to train a model and when postnet starts I run into the following issue

Traceback (most recent call last):
  File "train.py", line 300, in <module>
    main()
  File "train.py", line 296, in main
    train(0, args, hp, hp_str)
  File "train.py", line 169, in train
    sc_loss_, mag_loss_ = stft_loss(y_g_hat[:, :, :y.size(2)].squeeze(1), y.squeeze(1))
  File "/home/guest/Supreeth/hifigan-denoiser/hifigan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/guest/Supreeth/hifigan-denoiser/stft_loss.py", line 130, in forward
    sc_l, mag_l = f(x, y)
  File "/home/guest/Supreeth/hifigan-denoiser/hifigan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/guest/Supreeth/hifigan-denoiser/stft_loss.py", line 91, in forward
    sc_loss = self.spectral_convergenge_loss(x_mag, y_mag)
  File "/home/guest/Supreeth/hifigan-denoiser/hifigan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/guest/Supreeth/hifigan-denoiser/stft_loss.py", line 46, in forward
    return torch.norm(y_mag - x_mag, p="fro") / torch.norm(y_mag, p="fro")
RuntimeError: The size of tensor a (641) must match the size of tensor b (640) at non-singleton dimension 1

Is there a fix for this? thank you!

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

3 participants