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

module 'torch' has no attribute 'irfft #2

Open
anujndoshi opened this issue May 1, 2021 · 3 comments
Open

module 'torch' has no attribute 'irfft #2

anujndoshi opened this issue May 1, 2021 · 3 comments

Comments

@anujndoshi
Copy link

When running the example file on Colab with GPU it raises the error.

Downloading file 'Kevin_MacLeod_-_Vibe_Ace.hq.ogg' from 'https://librosa.org/data/audio/Kevin_MacLeod_-_Vibe_Ace.hq.ogg' to '/root/.cache/librosa'.
/usr/local/lib/python3.7/dist-packages/torch/functional.py:581: UserWarning: stft will soon require the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release. (Triggered internally at /pytorch/aten/src/ATen/native/SpectralOps.cpp:639.)
normalized, onesided, return_complex)

AttributeError Traceback (most recent call last)
in ()
16 mag = mag.cuda()
17
---> 18 yhat = griffin_lim(mag, maxiter=100, alpha=0.3, window=window)
19
20 # check convergence

1 frames
/usr/local/lib/python3.7/dist-packages/torch_specinv/methods.py in _istft(x, n_fft, win_length, window, hop_length, center, normalized, onesided, synth_coeff, offset, ola_weight)
88 A helper function to do istft.
89 """
---> 90 x = torch.irfft(x.transpose(0, 1), 1, normalized=normalized, onesided=onesided,
91 signal_sizes=[n_fft] if onesided else None)[:, offset:offset + win_length]
92

AttributeError: module 'torch' has no attribute 'irfft'

@BenjaminHavenaar
Copy link

BenjaminHavenaar commented Jan 20, 2022

Same issue here.

Downgrading to torch version 1.6.0. comes with older CUDA versions that are not compatible with the required versions for the RTX3090 GPU. Pytorch 1.8 would be oldest version that runs the right CUDA for this hardware but also gives the same error.

Is there a fix planned for this?

@HIN0209
Copy link

HIN0209 commented Apr 6, 2023

AttributeError: module 'torch' has no attribute 'rfft' with PyTorch
https://stackoverflow.com/questions/67647299/attributeerror-module-torch-has-no-attribute-rfft-with-pytorch

use torch.fft.rfft instead of torch.rfft.

@yoyolicoris
Copy link
Owner

Sorry, I missed this issue for a long time.
The problem is fixed in the latest version, but I haven't uploaded it to pypi yet.
I'll add relevant CICD for this soon.
The temporary solution is to install it from GitHub:

pip install git+https://github.com/yoyololicon/spectrogram-inversion

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

No branches or pull requests

4 participants