module 'torch' has no attribute 'irfft
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)
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'
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?
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.
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