torchkbnufft icon indicating copy to clipboard operation
torchkbnufft copied to clipboard

Is it compatible with the latest pytorch

Open Xieyyyy opened this issue 2 years ago • 6 comments

Hi, When I try to import the lib, there raises an error: AttributeError: module 'torch' has no attribute 'complex32'. How can I solve the issue? Thanks!

Xieyyyy avatar Jul 29 '22 16:07 Xieyyyy

Hello @Xieyyyy, did you install ignoring dependencies? I saw this issue with PyTorch 1.11.

https://github.com/mmuckley/torchkbnufft/blob/4e5acbf3d946d21a60a8c516f123762cf7a625c0/setup.py#L22

mmuckley avatar Aug 01 '22 15:08 mmuckley

Hi Matthew,

I have the same issue with PyTOrch 1.11.

I just removed the line in utils.py, and my code seemed to run fine. But I'm not sure if changing this has any further implications.

image

fschiffers avatar Aug 05 '22 15:08 fschiffers

Hello @fschiffers, that code is necessary for proper casting when using the .to() function of a module. Otherwise it may convert some tensors to real when they should remain complex.

mmuckley avatar Aug 05 '22 15:08 mmuckley

Thank you for your reply. @mmuckley How can I specify the ignoring dependencies? When installing or importing? Sorry for I am a rookie :)

Xieyyyy avatar Aug 27 '22 04:08 Xieyyyy

I have just re-install the lib with the command "pip install torchkbnufft --no-dependencies", but the same issue has raised.

Xieyyyy avatar Aug 27 '22 04:08 Xieyyyy

@Xieyyyy in this case we need to enforce dependencies - the package doesn't work on PyTorch 1.11.

mmuckley avatar Sep 22 '22 14:09 mmuckley

Solved by PR #77.

mmuckley avatar Nov 23 '22 22:11 mmuckley