matteo-ronchetti / torch-radon

Computational Tomography in PyTorch
https://torch-radon.readthedocs.io
GNU General Public License v3.0
218 stars 45 forks source link

pytorch 1.8.1 has a problm: module ‘torch‘ has no attribute "rfft" #54

Open Love-Sunshine opened 1 year ago

Love-Sunshine commented 1 year ago

pytorch 1.8.1 has a problm: module ‘torch‘ has no attribute "rfft"

Love-Sunshine commented 1 year ago

I use RTX 3090, the CUDA is 11.3

joesharratt1229 commented 1 year ago

Since pytorch>1.7, there has been a redesign of the torch.fft interface. Fourier transform functions such torch.rfft() are now available under different function calls such as torch.fft.rfft(). Here is the documentation. The v2 branch of the torch radon library reflects these changes.

Love-Sunshine commented 1 year ago

Thanks a lot. When I install the v2, Another problem has occurred. As followed: "torch_radon_cuda" not found. I find that "from torch_radon_cuda import *" is in "cuda_backend.py", but there is no "torch_radon_cuda.py", only "tr.py".

LinY-ct commented 7 months ago

ffted = torch.rfft(input, 1, onesided=False) to ffted = torch.view_as_real(torch.fft.fft(input, dim=1)) and iffted = torch.irfft(time_step_as_inner, 1, onesided=False) to iffted = torch.fft.irfft(torch.view_as_complex(time_step_as_inner), n=time_step_as_inner.shape[1], dim=1)

Love-Sunshine commented 7 months ago

Okay, thank you very much. I'll give it a try.