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

RuntimeError: The size of tensor a (40264) must match the size of tensor b (173) at non-singleton dimension 1 #2

Closed
Jackiexiao opened this issue Aug 23, 2022 · 4 comments

Comments

@Jackiexiao
Copy link

I use same code in https://github.com/KentoNishi/torch-time-stretch/blob/master/example.py but get below error

(librosa) ➜  torch-time-stretch git:(master) ✗ python example.py 
Traceback (most recent call last):
  File "/home/jackie/code/github/torch-time-stretch/example.py", line 48, in <module>
    test_time_stretch_2_up()
  File "/home/jackie/code/github/torch-time-stretch/example.py", line 20, in test_time_stretch_2_up
    up = time_stretch(sample, Fraction(1, 2), SAMPLE_RATE)
  File "/home/jackie/code/github/torch-time-stretch/torch_time_stretch/main.py", line 116, in time_stretch
    output = stretcher(output)
  File "/home/jackie/anaconda3/envs/librosa/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/jackie/anaconda3/envs/librosa/lib/python3.9/site-packages/torchaudio/transforms/_transforms.py", line 1059, in forward
    return F.phase_vocoder(complex_specgrams, rate, self.phase_advance)
  File "/home/jackie/anaconda3/envs/librosa/lib/python3.9/site-packages/torchaudio/functional/functional.py", line 743, in phase_vocoder
    phase = angle_1 - angle_0 - phase_advance
RuntimeError: The size of tensor a (40264) must match the size of tensor b (173) at non-singleton dimension 1
@KentoNishi
Copy link
Owner

I'm a little busy at the moment, but I'll try to debug this as soon as I can. In the meantime, could you let me know your pytorch and torchaudio versions?

@Jackiexiao
Copy link
Author

thx for your reply!

>>> torch.__version__
'1.12.1+cu102'
>>> torchaudio.__version__
'0.12.1+cu102'

@KentoNishi
Copy link
Owner

@Jackiexiao it's been fixed in v1.0.3! :)

@Jackiexiao
Copy link
Author

wow, thx!

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