module 'torch' has no attribute 'rfft'
See original GitHub issueWhen I try to run the example, I get a runtime error
>>> X = dct.dct(x) # DCT-II done through the last dimension
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/torch_dct/_dct.py", line 48, in dct
Vc = torch.rfft(v, 1, onesided=False)
AttributeError: module 'torch' has no attribute 'rfft'
my torch version is ‘1.10.2+cu113’. Did I miss something?
Also, I want to ask what is scaled DCT? Does the input of scaled DCT need to be in range [0,1]?
Thank you very much!
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
AttributeError: module 'torch' has no attribute 'rfft' with PyTorch
I am getting an error using a code that should work according to the documentation. The goal is to calculate the Feature Similarity...
Read more >AttributeError: module 'torch' has no attribute 'rfft' with PyTorch
I am getting an error using a code that should work according to the documentation. The goal is to calculate the Feature Similarity...
Read more >Fourier transform in latest pytorch - vision
fft_src = torch.rfft(src_img.clone(), signal_ndim=2, onesided=False). The error: AttributeError: module 'torch' has no attribute 'rfft'.
Read more >解决报错:AttributeError: module 'torch' has no attribute 'irfft'
解决报错:AttributeError: module 'torch' has no attribute 'irfft' ... try: from torch import irfft from torch import rfft except ...
Read more >旧版pytorch中torch.rfft和irfft在新版本中的对应 - 知乎专栏
pytorch旧版本(1.7之前)中有一个函数torch.rfft(),但是新版本(1.8、1.9)中被 ... 是安装1.7之前版本的pytorch,也会出现module 'torch' has no attribute 'rfft'.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Found the solution hidden in another post: https://github.com/zh217/torch-dct/issues/15#issuecomment-851439294
To migrate the DCT code to the newest pytorch version, you only have to change two lines; one in dct, one in idct.
dct:
idct:
Took me wayyy too long to figure out. Hope it helps you!
This can be closed now. Fixed in PR https://github.com/zh217/torch-dct/pull/24