mmuckley / torchkbnufft

A high-level, easy-to-deploy non-uniform Fast Fourier Transform in PyTorch.
https://torchkbnufft.readthedocs.io/
MIT License
201 stars 44 forks source link

Deprecation warning and shutdown #66

Closed 9B8DY6 closed 2 years ago

9B8DY6 commented 2 years ago

When I use ` self.nufft_ob = tkbn.KbNufft(im_size=im_size,

grid_size=(256,256),

    ).to(self.dev)`,

I got warning and shutdown

DeprecationWarning: `np.complex` is a deprecated alias for the builtin `complex`. To silence this warning, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

but there is no problem with tkbn.ToepNufft()

and I want to know how to inverse NuFFT with toepliz.

Thank you

kylematoba commented 2 years ago

self.nufft_ob = tkbn.KbNufft(im_size=im_size, #grid_size=(256,256), ).to(self.dev), is not syntatically correct python?

Not clear what you mean by "shutdown", but the warning is just a warning -- you can ignore, suppress, or fix (by replacing instances of np.complex with complex) without changing the computation.

mmuckley commented 2 years ago

As far as I can tell this is not used anywhere in the core package (but it is used in some examples).

https://github.com/mmuckley/torchkbnufft/search?q=np.complex

We should probably update the examples, but in your case @9B8DY6 it seems your self.dev is np.complex.

9B8DY6 commented 2 years ago

I solved this problem with filterwarning!