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

IndexError: too many indices for tensor of dimension 4 #25

Open
Lincoln20030413 opened this issue Jan 7, 2023 · 3 comments
Open

IndexError: too many indices for tensor of dimension 4 #25

Lincoln20030413 opened this issue Jan 7, 2023 · 3 comments

Comments

@Lincoln20030413
Copy link

File "../../utils/dcls_utils.py", line 50, in inv_fft_kernel_est
+ ker_p[:, :, :, :, 1] * ker_p[:, :, :, :, 1]
IndexError: too many indices for tensor of dimension 4
作者你好,能帮我看看这个问题吗?

@Algolzw
Copy link
Collaborator

Algolzw commented Jan 7, 2023

你的pytorch版本是多少呢?这个库的代码目前只支持pytorch1.7以下。

@Egkang-Luis
Copy link

Hi. I also got same issue when I run the code.

My python and pytorch version are 3.7.12 and 1.12.1 because I used GTX3090 and Cuda 11.7.

Actually I corrected code as like below to run.

  • Original code : otf = torch.rfft(psf, 3, onesided=False)
  • Modified code : otf = torch.fft.rfft(psf, 3) or otf = torch.fft.fft(psf, 3)

is there any possibility of in-correct function usage due to my code correction?

If you can advise how to correct code, it will be great to me!

Thanks.

@Algolzw
Copy link
Collaborator

Algolzw commented Jan 26, 2023

Hi. I also got same issue when I run the code.

My python and pytorch version are 3.7.12 and 1.12.1 because I used GTX3090 and Cuda 11.7.

Actually I corrected code as like below to run.

  • Original code : otf = torch.rfft(psf, 3, onesided=False)
  • Modified code : otf = torch.fft.rfft(psf, 3) or otf = torch.fft.fft(psf, 3)

is there any possibility of in-correct function usage due to my code correction?

If you can advise how to correct code, it will be great to me!

Thanks.

Perhaps you can ref this issue for higher pytorch version: #12 (comment)

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

3 participants