ml-struct-bio / cryodrgn

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

Backproject_voxel error #14

Open kimdn opened 4 years ago

kimdn commented 4 years ago

With published 50S ribosome set, and some of my own sets, I have no problem.

However, for two of my own sets, I have a problem with backproject_voxel (all other jobs, e.g. downsampling, generation of pkl files, train_vae, analyze, eval_vol worked well and produced expected results).

invert-data resulted in the same error message.

cryodrgn backproject_voxel cryosparc_P4_J251_009_particles_cs_abs_w_mrcs_star.mrcs --poses pose_300.pkl --ctf ctf.pkl -o backproject_w_pose_300_not_inverted_data.cryosparc_P4_J251_009_particles_cs_abs_w_mrcs_star.mrc --first 284133 -->

2020-06-18 01:14:58 Namespace(ctf='/pic/projects/MARScryo/cryodrgn/real_data/PDX/coexp/w_new_mrcs/ctf.pkl', datadir=None, first=284133, func=<function main at 0x7f335b0139e0>, ind=None, invert_data=False, o='/pic/projects/MARScryo/cryodrgn/real_data/PDX/coexp/w_new_mrcs/backproject_w_pose_300_not_inverted_data.cryosparc_P4_J251_009_particles_cs_abs_w_mrcs_star.mrc', particles='/pic/projects/MARScryo/cryodrgn/real_data/PDX/coexp/w_new_mrcs/cryosparc_P4_J251_009_particles_cs_abs_w_mrcs_star.mrcs', poses='/pic/projects/MARScryo/cryodrgn/real_data/PDX/coexp/w_new_mrcs/pose_300.pkl', tilt=None, tilt_deg=45) 2020-06-18 01:14:59 Use cuda True 2020-06-18 01:15:00 Loaded 284133 300x300 images 2020-06-18 01:15:04 Loading ctf params from /pic/projects/MARScryo/cryodrgn/real_data/PDX/coexp/w_new_mrcs/ctf.pkl 2020-06-18 01:15:04 Image size (pix) : 300 2020-06-18 01:15:04 A/pix : 1.0124000310897827 2020-06-18 01:15:04 DefocusU (A) : 21748.703125 2020-06-18 01:15:04 DefocusV (A) : 21489.791015625 2020-06-18 01:15:04 Dfang (deg) : -30.64923858642578 2020-06-18 01:15:04 voltage (kV) : 300.0 2020-06-18 01:15:04 cs (mm) : 2.700000047683716 2020-06-18 01:15:04 w : 0.07000000029802322 2020-06-18 01:15:04 Phase shift (deg) : 0.0 2020-06-18 01:15:04 Using circular lattice with radius 150 2020-06-18 01:15:04 image 0 ... 2020-06-18 01:20:24. image 19300

/tmp/pip-req-build-v3zvx_ui/aten/src/ATen/native/cuda/IndexKernel.cu:60: lambda ->auto::operator()(int)->auto: block: [44,0,0], thread: [112,0,0] Assertion index >= -sizes[i] && index < sizes[i] && "index out of bounds" failed. Traceback (most recent call last): File "/people/kimd999/bin/Miniconda3-latest-Linux-x86_64/envs/cryodrgn/bin/cryodrgn", line 11, in load_entry_point('cryodrgn==0.2.1b0', 'console_scripts', 'cryodrgn')() File "/people/kimd999/bin/Miniconda3-latest-Linux-x86_64/envs/cryodrgn/lib/python3.7/site-packages/cryodrgn-0.2.1b0-py3.7.egg/cryodrgn/main.py", line 50, in main args.func(args) File "/people/kimd999/bin/Miniconda3-latest-Linux-x86_64/envs/cryodrgn/lib/python3.7/site-packages/cryodrgn-0.2.1b0-py3.7.egg/cryodrgn/commands/backproject_voxel.py", line 126, in main add_slice(V, counts, ff_coord, ff, D) File "/people/kimd999/bin/Miniconda3-latest-Linux-x86_64/envs/cryodrgn/lib/python3.7/site-packages/cryodrgn-0.2.1b0-py3.7.egg/cryodrgn/commands/backproject_voxel.py", line 54, in add_slice add_for_corner(xf,yc,zf) File "/people/kimd999/bin/Miniconda3-latest-Linux-x86_64/envs/cryodrgn/lib/python3.7/site-packages/cryodrgn-0.2.1b0-py3.7.egg/cryodrgn/commands/backproject_voxel.py", line 49, in add_for_corner w[w<0]=0 RuntimeError: copy_if failed to synchronize: device-side assert triggered

zhonge commented 4 years ago

Hi Doonam,

I will look into this. I suspect that there is a pose whose rotation falls exactly on the axis, which then causes something to get rounded to beyond the defined extent of the volume.

In the meantime, you could try --first 19300 to only backproject the first 19300 particles. I usually run this step just as a sanity check that the poses were parsed correctly before training.

Thanks, Ellen

kimdn commented 4 years ago

Thank you, that's a good point. Yes, indeed when I ran only up-to 19300 images, I got expected mrc file. Additionally, eval_vol with this data set resulted in expected volume as well.