Skip to content

Problem with Cov3D #1197

@ThinkJanice

Description

@ThinkJanice

Describe the bug:
Estimate the noise of images using AnisotropicNoiseEstimator
0%| | 0/10 [00:05<?, ?it/s]
2024-10-10 19:27:31,441 CRITICAL [root] Implicit conversion to a NumPy array is not allowed. Please use .get() to construct a NumPy array explicitly.
Traceback:
File "cov3d_dimer_1k_volume.py", line 99, in
noise_estimator = AnisotropicNoiseEstimator(source, batchSize=batchsize) #check also
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/noise/noise.py", line 244, in init
self.filter = self._create_filter()
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/noise/noise.py", line 321, in _create_filter
noise_psd = self.estimate_noise_psd()
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/noise/noise.py", line 336, in estimate_noise_psd
images = self.src.images[i : i + self.batchSize].asnumpy()
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/source/image.py", line 102, in getitem
return self.fun(indices)
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/source/relion.py", line 275, in _images
return self.generation_pipeline.forward(Image(im), indices)
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/image/xform.py", line 68, in forward
return self._forward(im, indices=indices)
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/image/xform.py", line 438, in _forward
im = _apply_transform_cached(xform, im, indices, False)
File "/home/jingjing/anaconda3/envs/1115/lib/python3.8/site-packages/joblib/memory.py", line 312, in call
return self.func(*args, **kwargs)
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/image/xform.py", line 373, in _apply_xform
return xform.forward(im, indices=indices)
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/image/xform.py", line 68, in forward
return self._forward(im, indices=indices)
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/image/xform.py", line 207, in _forward
return im.downsample(self.resolution)
File "/home/jingjing/Newdisk3/fast-PCA/Cov3D-master/ASPIRE-Python_v2/code_folder/../src/aspire/image/image.py", line 362, in downsample
crop_fx = np.array([crop_pad_2d(fx[i], ds_res) for i in range(self.n_images)])
File "cupy/_core/core.pyx", line 1475, in cupy._core.core._ndarray_base.array

To Reproduce:
When I set:
common:
# numeric module to use - one of numpy/cupy
numeric: cupy
# fft backend to use - one of pyfftw/scipy/cupy/mkl
fft: cupy
the error appear.

If I set:
common:
# numeric module to use - one of numpy/cupy
numeric: numpy
# fft backend to use - one of pyfftw/scipy/cupy/mkl
fft: pyfftw
it works well.

Expected behavior:
I hope to know the reason of the bug

Environment (please complete the following information):

  • Python: [e.g. Python 3.8]
  • ASPIRE Version: [12.0, develop]
  • CPU Type: [Ubuntu 22.04]
  • GPU Extensions: [yes]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions