Select 2D Classes runs out of memory

Hi,

I am running a successful 2D classification on a particle stack that was imported as a single mrcs file (might be a relevant detail?), but I get the following error when trying to select any of the 2D classes.

[CPU: 76.99 GB]  Traceback (most recent call last):
   File "cryosparc2_master/cryosparc2_compute/run.py", line 78, in cryosparc2_compute.run.main
   File "cryosparc2_compute/jobs/select2D/run.py", line 262, in run
 _, particles_to_plot = mrc.read_mrc(os.path.join(proj_dir_abs, particles_dset_exclude.data['blob/path'][0]))
   File "cryosparc2_compute/blobio/mrc.py", line 114, in read_mrc
 data = read_mrc_data(file_obj, header, start_page, end_page, out)
   File "cryosparc2_compute/blobio/mrc.py", line 77, in read_mrc_data
 data = n.fromfile(file_obj, dtype=dtype, count= num_pages * ny * nx).reshape(num_pages, ny, nx)
 MemoryError

I have not had this issue before. I’m running verision 2.13.2.

Hey @stefan,

This is a known bug, thank you for reporting! The problem, as you predicted, arises from the code trying to load the entire particle stack into memory. You can see a similar post here:

Which includes a link to another discussion forum post where I attached a patch file.
Let me know if it works for you!

Hi @stephan,

Works like a charm. Thank you and sorry for spamming with a new topic!

Cheers,
Stefan

1 Like