wavefrontshaping / article_MMF_disorder

https://www.wavefrontshaping.net
MIT License
16 stars 2 forks source link

What is the version of pytorch of this code? #1

Open Methory opened 6 months ago

Methory commented 6 months ago

i meet errors of dtype with pytorch, the repo as follows, i think is the version of pytorch causing this, my pytorch version is 1.13.1+cu116 /home/dell/anaconda3/envs/ddpm/lib/python3.8/site-packages/torch/nn/functional.py:4289: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details. warnings.warn( /home/dell/anaconda3/envs/ddpm/lib/python3.8/site-packages/torch/nn/functional.py:4227: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details. warnings.warn( Traceback (most recent call last): File "/data/hll/liangliang/article_MMF_disorder-main/Aberration_correction/temp.py", line 154, in y_pred = model(pt_modes_in,pt_modes_out) File "/home/dell/anaconda3/envs/ddpm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, kwargs) File "/data/hll/liangliang/article_MMF_disorder-main/Aberration_correction/PyTorchAberrations/aberration_models.py", line 37, in forward output_modes = self.abberation_output(output_modes) File "/home/dell/anaconda3/envs/ddpm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/data/hll/liangliang/article_MMF_disorder-main/Aberration_correction/PyTorchAberrations/aberration_models.py", line 103, in forward input = self.zernike_ft(input) File "/home/dell/anaconda3/envs/ddpm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "/home/dell/anaconda3/envs/ddpm/lib/python3.8/site-packages/torch/nn/modules/container.py", line 204, in forward input = module(input) File "/home/dell/anaconda3/envs/ddpm/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, **kwargs) File "/data/hll/liangliang/article_MMF_disorder-main/Aberration_correction/PyTorchAberrations/aberration_layers.py", line 142, in forward return ComplexZernikeFunction.apply(input, self.alpha, self.j) File "/data/hll/liangliang/article_MMF_disorder-main/Aberration_correction/PyTorchAberrations/aberration_layers.py", line 23, in forward nx = torch.arange(0,1,1./input.shape[1], dtype = input.dtype) RuntimeError: "arange_cpu" not implemented for 'ComplexFloat'

wavefrontshaping commented 5 months ago

Hi,

I think we used version 1.4 at the time, but I cannot manage to build an environment to make it work now. Alternatively, you can install a newer version of our PyTorchAberration module, which is available at rodguti90/PyTorchAberrations. It is compatible with latest versions of PyTorch, that now support natively complex values. Just replace the content of the PyTorchAberrations folder with the new files.

Methory commented 3 months ago

Thank you! It work!