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

scale_invariance broken #56

Open
turian opened this issue Mar 10, 2023 · 2 comments
Open

scale_invariance broken #56

turian opened this issue Mar 10, 2023 · 2 comments

Comments

@turian
Copy link
Contributor

turian commented Mar 10, 2023

I just enabled scale invariance = True with MultiResolutionSTFTLoss. I am getting this error both with 0.3.0 and main.

The size of the tensors passed in are:

torch.Size([2, 7307212]) torch.Size([2, 7307212])

However, now I start getting errors:

...
  File "/home/ubuntu/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/auraloss/freq.py", line 371, in forward
    mrstft_loss += f(x, y)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/auraloss/freq.py", line 202, in forward
    y_mag = y_mag * alpha.unsqueeze(-1)
RuntimeError: The size of tensor a (513) must match the size of tensor b (2) at non-singleton dimension 1
@csteinmetz1
Copy link
Owner

scale_invariance is currently still a bit experimental, but shouldn't throw an error.

Let me try to reproduce.

@turian
Copy link
Contributor Author

turian commented Mar 10, 2023

Hacking this quickly @khumairraj suggests this fix:

            y_mag = y_mag * alpha.unsqueeze(-1).unsqueeze(-1)

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