Reference-based motion correction: "operands could not be broadcast together"

Dear @rwaldo

Sorry for replying to such an old post, but I’m getting this same error on a Reference-Based Motion Correction job. I’d ran this job previously on the same dataset and it ran without error, but I’ve been trying to run it with a new reference volume that uses particles re-extracted at 512px and a smaller subset of particles - and I can’t seem to get it to work.

[CPU:   1.33 GB]
Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 129, in cryosparc_master.cryosparc_compute.run.main
  File "cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_reference_motion.py", line 219, in cryosparc_master.cryosparc_compute.jobs.motioncorrection.run_reference_motion.run_reference_motion_correction
  File "cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_reference_motion.py", line 83, in cryosparc_master.cryosparc_compute.jobs.motioncorrection.run_reference_motion.get_vols_and_fsc
  File "/appl/soft/bio/cryosparc/4.7.1/cryosparc_worker/cryosparc_compute/sigproc.py", line 1028, in compute_masked_fsc
    radwns, fsc_mask = get_fsc(rMA, rMB, radwn_max, mask)
  File "/appl/soft/bio/cryosparc/4.7.1/cryosparc_worker/cryosparc_compute/sigproc.py", line 1009, in get_fsc
    fMA = fourier.fft(rMA * mask)
ValueError: operands could not be broadcast together with shapes (512,512,512) (108,108,108)

I’m not cropping the box size in the parameters. I tried setting it to 512px in one of the jobs to see if this would help, but that didn’t help. Asides from that, I tried used the default settings and I also tried setting the hyperparameter search thoroughness to extensive but neither worked.

I had previously ran the job on the same dataset using a reference map that had a smaller box size, and that ran with no issues. i’m trying to rerun that same old job now just to see if it gives any error. It’s queueing on the cluster so I’ll update this once it runs.

The previously-succesful job was run on an older version (July 2025, im not sure how to check what version CS that was). I’m currently running v4.7.1 because our HPC is not compatible with the newer version so I’m forced to keep using it for the time being.

@newbie Please can you post the output of the following (CryoSPARC v4-specific) command

cs_project_id="P99" # replace with actual project ID
cs_job_id="J9" # replace with actual job ID
cryosparcm cli "get_job('$cs_project_id', '$cs_job_id', 'type', 'input_slot_groups.connections.slots')"

Thank you for responding! Here it is:

{'_id': '6a8c70e792672f3ed7bd9e9d', 'input_slot_groups': [{'connections': [{'slots': [{'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'movie_blob', 'result_type': 'exposure.movie_blob', 'slot_name': 'movie_blob', 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'gain_ref_blob', 'result_type': 'exposure.gain_ref_blob', 'slot_name': 'gain_ref_blob', 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'mscope_params', 'result_type': 'exposure.mscope_params', 'slot_name': 'mscope_params', 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'rigid_motion', 'result_type': 'exposure.motion', 'slot_name': 'rigid_motion', 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'spline_motion', 'result_type': 'exposure.motion', 'slot_name': 'spline_motion', 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'background_blob', 'result_type': 'exposure.stat_blob', 'slot_name': 'background_blob', 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'ctf', 'result_type': 'exposure.ctf', 'slot_name': None, 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'ctf_stats', 'result_type': 'exposure.ctf_stats', 'slot_name': None, 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'micrograph_blob_non_dw', 'result_type': 'exposure.micrograph_blob', 'slot_name': None, 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'micrograph_blob', 'result_type': 'exposure.micrograph_blob', 'slot_name': None, 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'micrograph_blob_non_dw_AB', 'result_type': 'exposure.micrograph_blob', 'slot_name': None, 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'micrograph_thumbnail_blob_1x', 'result_type': 'exposure.thumbnail_blob', 'slot_name': None, 'version': 'F'}, {'group_name': 'exposures', 'job_uid': 'J4', 'result_name': 'micrograph_thumbnail_blob_2x', 'result_type': 'exposure.thumbnail_blob', 'slot_name': None, 'version': 'F'}]}]}, {'connections': []}, {'connections': [{'slots': [{'group_name': 'particles', 'job_uid': 'J628', 'result_name': 'blob', 'result_type': 'particle.blob', 'slot_name': 'blob', 'version': 'F'}, {'group_name': 'particles', 'job_uid': 'J628', 'result_name': 'location', 'result_type': 'particle.location', 'slot_name': 'location', 'version': 'F'}, {'group_name': 'particles', 'job_uid': 'J628', 'result_name': 'alignments3D', 'result_type': 'particle.alignments3D', 'slot_name': 'alignments3D', 'version': 'F'}, {'group_name': 'particles', 'job_uid': 'J628', 'result_name': 'ctf', 'result_type': 'particle.ctf', 'slot_name': 'ctf', 'version': 'F'}, {'group_name': 'particles', 'job_uid': 'J628', 'result_name': 'alignments2D', 'result_type': 'particle.alignments2D', 'slot_name': None, 'version': 'F'}, {'group_name': 'particles', 'job_uid': 'J628', 'result_name': 'pick_stats', 'result_type': 'particle.pick_stats', 'slot_name': None, 'version': 'F'}]}]}, {'connections': [{'slots': [{'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'map', 'result_type': 'volume.blob', 'slot_name': 'map', 'version': 'F'}, {'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'map_half_A', 'result_type': 'volume.blob', 'slot_name': 'map_half_A', 'version': 'F'}, {'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'map_half_B', 'result_type': 'volume.blob', 'slot_name': 'map_half_B', 'version': 'F'}, {'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'mask_refine', 'result_type': 'volume.blob', 'slot_name': 'mask_refine', 'version': 'F'}, {'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'map_sharp', 'result_type': 'volume.blob', 'slot_name': None, 'version': 'F'}, {'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'mask_fsc', 'result_type': 'volume.blob', 'slot_name': None, 'version': 'F'}, {'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'mask_fsc_auto', 'result_type': 'volume.blob', 'slot_name': None, 'version': 'F'}, {'group_name': 'volume', 'job_uid': 'J628', 'result_name': 'precision', 'result_type': 'volume.blob', 'slot_name': None, 'version': 'F'}]}]}, {'connections': [{'slots': [{'group_name': 'mask', 'job_uid': 'J562', 'result_name': 'mask', 'result_type': 'volume.blob', 'slot_name': 'mask', 'version': 'F'}]}]}], 'project_uid': 'P1', 'type': 'reference_motion_correction', 'uid': 'J654'}