Select 2D Classes runs out of memory


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/", line 78, in
   File "cryosparc2_compute/jobs/select2D/", line 262, in run
 _, particles_to_plot = mrc.read_mrc(os.path.join(proj_dir_abs,['blob/path'][0]))
   File "cryosparc2_compute/blobio/", line 114, in read_mrc
 data = read_mrc_data(file_obj, header, start_page, end_page, out)
   File "cryosparc2_compute/blobio/", line 77, in read_mrc_data
 data = n.fromfile(file_obj, dtype=dtype, count= num_pages * ny * nx).reshape(num_pages, ny, nx)

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!


1 Like