ml-struct-bio / cryodrgn

Neural networks for cryo-EM reconstruction
http://cryodrgn.cs.princeton.edu
GNU General Public License v3.0
316 stars 76 forks source link

backproject_voxel gives error #160

Open olibclarke opened 2 years ago

olibclarke commented 2 years ago

Hi,

When I attempt to run backproject_voxel in order to validate parsing of poses and CTF params, I get the resulting error. This is using version cryoDRGN 1.0.1.dev126+g04c4a90 as reported by cryodrgn --version.

(cryodrgn2) cryodrgn backproject_voxel ank_downsample_128.mrcs --ctf ank_ctf_fixed.pkl --poses ank_pose_fixed.pkl --ind ank_downsample_20k.pkl -o test_reconstruct.mrc
2022-10-24 12:41:04.124136     Namespace(particles='/data/processing/cryodrgn_test/ank_downsample_128.mrcs', poses='/data/processing/cryodrgn_test/ank_pose_fixed.pkl', ctf='/data/processing/cryodrgn_test/ank_ctf_fixed.pkl', o='/data/processing/cryodrgn_test/test_reconstruct.mrc', invert_data=True, datadir=None, ind='ank_downsample_20k.pkl', first=10000, preprocessed=False, tilt=None, tilt_deg=45, func=<function main at 0x7fa37f506af0>)
2022-10-24 12:41:04.178058     Use cuda True
2022-10-24 12:41:05.590865     Loaded 20000 128x128 images
Traceback (most recent call last):
  File "/usr/local/envs/cryodrgn2/bin/cryodrgn", line 8, in <module>
    sys.exit(main())
  File "/usr/local/envs/cryodrgn2/lib/python3.9/site-packages/cryodrgn/__main__.py", line 64, in main
    args.func(args)
  File "/usr/local/envs/cryodrgn2/lib/python3.9/site-packages/cryodrgn/commands/backproject_voxel.py", line 85, in main
    data = dataset.LazyMRCData(args.particles, norm=(0,1), invert_data=args.invert_data, datadir=args.datadir, ind=args.ind)
  File "/usr/local/envs/cryodrgn2/lib/python3.9/site-packages/cryodrgn/dataset.py", line 55, in __init__
    self.particles = particles.astype(np.float32)
AttributeError: 'list' object has no attribute 'astype'
Guillawme commented 2 years ago

I have used backproject_voxel without error, but I never tried it with the --ind option. Do you also get an error without this option?

olibclarke commented 2 years ago

Yes, I thought that might be the issue too, but saw the same error without this flag.