Patch motion corr: AssertionError: Get rid of patches that are too close to edges

I get this error when running patch motion corr.
what can i do?

Hi @conaty,

Is it possible if you can post the full traceback as well as some text from the job itself? The job reports how many knots it uses. Also what kind of movies were you processing (e.g. K2 supperres, K3, etc.)

1 Like

License is valid.

Launching job on lane default target localhost …

Running job on master node hostname localhost

[CPU: 99.1 MB] Project P4 Job J84 Started

[CPU: 99.1 MB] Master running v2.15.0, worker running v2.15.0

[CPU: 99.3 MB] Running on lane default

[CPU: 99.3 MB] Resources allocated:

[CPU: 99.3 MB] Worker: localhost

[CPU: 99.3 MB] CPU : [0, 1, 2, 3, 4, 5]

[CPU: 99.3 MB] GPU : [0]

[CPU: 99.3 MB] RAM : [0, 1]

[CPU: 99.3 MB] SSD : False

[CPU: 99.3 MB] --------------------------------------------------------------

[CPU: 99.3 MB] Importing job module for job type patch_motion_correction_multi…

[CPU: 198.9 MB] Job ready to run

[CPU: 198.9 MB] ***************************************************************

[CPU: 199.6 MB] Job will process this many movies: 2001

[CPU: 199.6 MB] parent process is 3832

[CPU: 140.8 MB] Calling CUDA init from 3863

[CPU: 608.9 MB] – 0.0: processing 0 of 2001: J74/imported/BetaG_105kX_0000.tif
loading /scratch/emlab/jianshi/SerialEM/BetaG_K3Test/P4/J74/imported/BetaG_105kX_0000.tif
Loading raw movie data from J74/imported/BetaG_105kX_0000.tif …
Done in 1.96s
Loading gain data from J74/imported/CountRef_BetaG_K3__0001.mrc …
Done in 0.08s
Processing …

[CPU: 882.6 MB] Traceback (most recent call last):
File “cryosparc2_compute/jobs/runcommon.py”, line 1685, in run_with_except_hook
run_old(*args, **kw)
File “/media/jianshi/EM_data/cryosparc/cryosparc2_worker/deps/anaconda/lib/python2.7/threading.py”, line 754, in run
self.__target(*self.__args, **self.__kwargs)
File “cryosparc2_compute/jobs/pipeline.py”, line 165, in thread_work
work = processor.process(item)
File “cryosparc2_worker/cryosparc2_compute/jobs/motioncorrection/run_patch.py”, line 157, in cryosparc2_compute.jobs.motioncorrection.run_patch.run_patch_motion_correction_multi.motionworker.process
File “cryosparc2_worker/cryosparc2_compute/jobs/motioncorrection/run_patch.py”, line 160, in cryosparc2_compute.jobs.motioncorrection.run_patch.run_patch_motion_correction_multi.motionworker.process
File “cryosparc2_worker/cryosparc2_compute/jobs/motioncorrection/run_patch.py”, line 161, in cryosparc2_compute.jobs.motioncorrection.run_patch.run_patch_motion_correction_multi.motionworker.process
File “cryosparc2_worker/cryosparc2_compute/jobs/motioncorrection/patchmotion.py”, line 77, in cryosparc2_compute.jobs.motioncorrection.patchmotion.unbend_motion_correction
File “cryosparc2_worker/cryosparc2_compute/jobs/motioncorrection/patchmotion.py”, line 138, in cryosparc2_compute.jobs.motioncorrection.patchmotion.unbend_motion_correction
AssertionError: Get rid of patches that are too close to edges

[CPU: 203.1 MB] Outputting partial results now…
[CPU: 203.9 MB] Traceback (most recent call last):
File “cryosparc2_worker/cryosparc2_compute/run.py”, line 85, in cryosparc2_compute.run.main
File “cryosparc2_worker/cryosparc2_compute/jobs/motioncorrection/run_patch.py”, line 359, in cryosparc2_compute.jobs.motioncorrection.run_patch.run_patch_motion_correction_multi
AssertionError: Child process with PID 3863 has terminated unexpectedly!

I ran into the same error with v2.15.0 just today

  1. It is running OK on some other dataset
  2. Full frame alignment is running OK
  3. I don’t see anything particular wrong in this dataset
  4. The dataset is K3 bin1 movie with 35 frames.
  5. I recompiled/reinstalled the cryosparc since I thought it may due to recent changes on cuda. Still the same.
    Any suggestions are appreciated

Why is this query closed?
I am running into the same problem and I can not find the solution anywhere. Anyone figured this out?

@73km, Can you please let us know:

  • which cryoSPARC version
  • copy and paste the entire traceback from the Patch Motion Correction job
  • let us know if you changed any parameters from their defaults

Thanks

Current version: 3.2.0
I used only the default values.

[CPU: 70.2 MB] Project P2 Job J33 Started

[CPU: 70.2 MB] Master running v3.2.0, worker running v3.2.0

[CPU: 70.5 MB] Running on lane Mortimer

[CPU: 70.5 MB] Resources allocated:

[CPU: 70.5 MB] Worker: Mortimer

[CPU: 70.5 MB] CPU : [0, 1, 2, 3, 4, 5, 6, 7]

[CPU: 70.5 MB] GPU : [0, 1, 2, 3]

[CPU: 70.5 MB] RAM : [0]

[CPU: 70.5 MB] SSD : False

[CPU: 70.5 MB] --------------------------------------------------------------

[CPU: 70.5 MB] Importing job module for job type patch_ctf_estimation_multi…

[CPU: 180.5 MB] Job ready to run

[CPU: 180.5 MB] ***************************************************************

[CPU: 187.3 MB] Job will process this many micrographs: 3370

[CPU: 187.5 MB] parent process is 120651

[CPU: 148.9 MB] Calling CUDA init from 120728

[CPU: 148.9 MB] Calling CUDA init from 120727

[CPU: 148.9 MB] Calling CUDA init from 120726

[CPU: 149.0 MB] Calling CUDA init from 120729

[CPU: 297.7 MB] – 1.0: processing 0 of 3370: J14/motioncorrected/015311125836325277589_FoilHole_24015405_Data_24016401_24016403_20200225_0014_Fractions.mrc_patch_aligned.mrc
loading /home/tmalla/Data/tmalla/EM/practice/apoferritin/P2/J14/motioncorrected/015311125836325277589_FoilHole_24015405_Data_24016401_24016403_20200225_0014_Fractions.mrc_patch_aligned.mrc
Loading raw mic data from J14/motioncorrected/015311125836325277589_FoilHole_24015405_Data_24016401_24016403_20200225_0014_Fractions.mrc_patch_aligned.mrc …
Done in 1.44s
Processing …

[CPU: 297.6 MB] – 0.0: processing 1 of 3370: J14/motioncorrected/012911080231436035426_FoilHole_24015405_Data_24016511_24016513_20200225_0014_Fractions.mrc_patch_aligned.mrc
loading /home/tmalla/Data/tmalla/EM/practice/apoferritin/P2/J14/motioncorrected/012911080231436035426_FoilHole_24015405_Data_24016511_24016513_20200225_0014_Fractions.mrc_patch_aligned.mrc
Loading raw mic data from J14/motioncorrected/012911080231436035426_FoilHole_24015405_Data_24016511_24016513_20200225_0014_Fractions.mrc_patch_aligned.mrc …
Done in 1.44s
Processing …

[CPU: 298.4 MB] – 0.0: processing 2 of 3370: J14/motioncorrected/009400554282141921718_FoilHole_24015406_Data_24016401_24016403_20200225_0015_Fractions.mrc_patch_aligned.mrc
loading /home/tmalla/Data/tmalla/EM/practice/apoferritin/P2/J14/motioncorrected/009400554282141921718_FoilHole_24015406_Data_24016401_24016403_20200225_0015_Fractions.mrc_patch_aligned.mrc
Loading raw mic data from J14/motioncorrected/009400554282141921718_FoilHole_24015406_Data_24016401_24016403_20200225_0015_Fractions.mrc_patch_aligned.mrc …

[CPU: 298.5 MB] – 1.0: processing 3 of 3370: J14/motioncorrected/011271738146303554424_FoilHole_24015406_Data_24016511_24016513_20200225_0015_Fractions.mrc_patch_aligned.mrc
loading /home/tmalla/Data/tmalla/EM/practice/apoferritin/P2/J14/motioncorrected/011271738146303554424_FoilHole_24015406_Data_24016511_24016513_20200225_0015_Fractions.mrc_patch_aligned.mrc
Loading raw mic data from J14/motioncorrected/011271738146303554424_FoilHole_24015406_Data_24016511_24016513_20200225_0015_Fractions.mrc_patch_aligned.mrc …

[CPU: 194.1 MB] Error occurred while processing J14/motioncorrected/012911080231436035426_FoilHole_24015405_Data_24016511_24016513_20200225_0014_Fractions.mrc_patch_aligned.mrc
Traceback (most recent call last):
File “/raid-18/LS/smarius/cryosparc/cryosparc_worker/cryosparc_compute/jobs/pipeline.py”, line 59, in exec
return self.process(item)
File “cryosparc_worker/cryosparc_compute/jobs/ctf_estimation/run.py”, line 112, in cryosparc_compute.jobs.ctf_estimation.run.run.ctfworker.process
File “cryosparc_worker/cryosparc_compute/jobs/ctf_estimation/run.py”, line 118, in cryosparc_compute.jobs.ctf_estimation.run.run.ctfworker.process
File “cryosparc_worker/cryosparc_compute/jobs/ctf_estimation/run.py”, line 119, in cryosparc_compute.jobs.ctf_estimation.run.run.ctfworker.process
File “cryosparc_worker/cryosparc_compute/jobs/ctf_estimation/patchctf.py”, line 70, in cryosparc_compute.jobs.ctf_estimation.patchctf.patchctf_v217
File “cryosparc_worker/cryosparc_compute/jobs/ctf_estimation/patchctf.py”, line 87, in cryosparc_compute.jobs.ctf_estimation.patchctf.patchctf_v217
AssertionError: Get rid of patches that are too close to edges

Marking J14/motioncorrected/012911080231436035426_FoilHole_24015405_Data_24016511_24016513_20200225_0014_Fractions.mrc_patch_aligned.mrc as incomplete and continuing…

[CPU: 194.1 MB] Outputting partial results now…
[CPU: 195.5 MB] Traceback (most recent call last):
File “cryosparc_worker/cryosparc_compute/run.py”, line 84, in cryosparc_compute.run.main
File “cryosparc_worker/cryosparc_compute/jobs/ctf_estimation/run.py”, line 256, in cryosparc_compute.jobs.ctf_estimation.run.run
AssertionError: Child process with PID 120728 has terminated unexpectedly!

Hi @73km,

Sometimes this message appears when processing high magnification data… What’s the pixel size of the movies you’re importing?

–Harris

The raw pixel size is 0.452A. I am practicing from 10424 EMPIAR dataset.

@73km, try using an output F-crop factor of 3/4 or less in motion correction. I assume you’re using an EER upsampling factor of 2 (the default)? I seem to recall that does put 10424 into “high magnification” territory and cause this issue unless an F-crop is applied.

1 Like

Okay. It worked. Thanks!

SOLVED: wrong pixel size was set :slight_smile:

Hi,
I am running into the same problem. I am using .tiff files and raw pixel size is 0.76A. Current version 4.21. Any ideas why this is the problem? For some datasets at the same magnification (190kx) it is working just fine.

Thank you!

[2023-04-21 11:51:19.54]
[CPU:  195.1 MB  Avail:  80.67 GB]
Job J3 Started

[2023-04-21 11:51:19.60]
[CPU:  195.1 MB  Avail:  80.68 GB]
Master running v4.2.1, worker running v4.2.1

[2023-04-21 11:51:19.62]
[CPU:  195.2 MB  Avail:  80.67 GB]
Working in directory: /media/longstorage/Tadej/CS-walker/J3

[2023-04-21 11:51:19.63]
[CPU:  195.2 MB  Avail:  80.66 GB]
Running on lane default

[2023-04-21 11:51:19.64]
[CPU:  195.2 MB  Avail:  80.65 GB]
Resources allocated: 

[2023-04-21 11:51:19.64]
[CPU:  195.2 MB  Avail:  80.65 GB]
  Worker:  perun-d12

[2023-04-21 11:51:19.65]
[CPU:  195.2 MB  Avail:  80.64 GB]
  CPU   :  [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]

[2023-04-21 11:51:19.65]
[CPU:  195.2 MB  Avail:  80.63 GB]
  GPU   :  [2, 3]

[2023-04-21 11:51:19.66]
[CPU:  195.2 MB  Avail:  80.59 GB]
  RAM   :  [4, 5, 6, 7]

[2023-04-21 11:51:19.68]
[CPU:  195.2 MB  Avail:  80.60 GB]
  SSD   :  False

[2023-04-21 11:51:19.68]
[CPU:  195.2 MB  Avail:  80.59 GB]
--------------------------------------------------------------

[2023-04-21 11:51:19.69]
[CPU:  195.2 MB  Avail:  80.58 GB]
Importing job module for job type patch_motion_correction_multi...

[2023-04-21 11:51:22.41]
[CPU:  230.6 MB  Avail:  80.25 GB]
Job ready to run

[2023-04-21 11:51:22.41]
[CPU:  230.6 MB  Avail:  80.25 GB]
***************************************************************

[2023-04-21 11:51:22.46]
[CPU:  232.0 MB  Avail:  80.25 GB]
Job will process this many movies:  1838

[2023-04-21 11:51:22.46]
[CPU:  232.0 MB  Avail:  80.25 GB]
parent process is 61667

[2023-04-21 11:51:22.58]
[CPU:  167.0 MB  Avail:  80.22 GB]
Calling CUDA init from 61782

[2023-04-21 11:51:22.58]
[CPU:  167.0 MB  Avail:  80.22 GB]
Calling CUDA init from 61781

[2023-04-21 11:51:22.97]
[CPU:  284.8 MB  Avail:  79.94 GB]
-- 0.0: processing 1 of 1838: J2/imported/000440060893008700367_FoilHole_20483863_Data_20492038_20492040_20230420_202742_Fractions.tif
        loading /media/longstorage/Tadej/CS-walker/J2/imported/000440060893008700367_FoilHole_20483863_Data_20492038_20492040_20230420_202742_Fractions.tif
        Loading raw movie data from J2/imported/000440060893008700367_FoilHole_20483863_Data_20492038_20492040_20230420_202742_Fractions.tif ...
        Done in 2.20s
        Processing ...

[2023-04-21 11:51:22.98]
[CPU:  284.9 MB  Avail:  79.93 GB]
-- 1.0: processing 2 of 1838: J2/imported/017211296635942485102_FoilHole_20483864_Data_20492038_20492040_20230420_202813_Fractions.tif
        loading /media/longstorage/Tadej/CS-walker/J2/imported/017211296635942485102_FoilHole_20483864_Data_20492038_20492040_20230420_202813_Fractions.tif
        Loading raw movie data from J2/imported/017211296635942485102_FoilHole_20483864_Data_20492038_20492040_20230420_202813_Fractions.tif ...
        Done in 2.19s
        Processing ...

[2023-04-21 11:51:27.33]
[CPU:  515.1 MB  Avail:  80.29 GB]
-- 1.0: processing 3 of 1838: J2/imported/016028151993127906566_FoilHole_20483865_Data_20492038_20492040_20230420_202845_Fractions.tif
        loading /media/longstorage/Tadej/CS-walker/J2/imported/016028151993127906566_FoilHole_20483865_Data_20492038_20492040_20230420_202845_Fractions.tif
        Loading raw movie data from J2/imported/016028151993127906566_FoilHole_20483865_Data_20492038_20492040_20230420_202845_Fractions.tif ...
        Done in 2.11s
        Processing ...

[2023-04-21 11:51:27.34]
[CPU:  234.5 MB  Avail:  80.31 GB]
Error occurred while processing J2/imported/017211296635942485102_FoilHole_20483864_Data_20492038_20492040_20230420_202813_Fractions.tif
Traceback (most recent call last):
  File "/home/perun-d12/PROGRAMS/cryosparc/cryosparc_worker/cryosparc_compute/jobs/pipeline.py", line 60, in exec
    return self.process(item)
  File "cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_patch.py", line 177, in cryosparc_compute.jobs.motioncorrection.run_patch.run_patch_motion_correction_multi.motionworker.process
  File "cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_patch.py", line 180, in cryosparc_compute.jobs.motioncorrection.run_patch.run_patch_motion_correction_multi.motionworker.process
  File "cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_patch.py", line 182, in cryosparc_compute.jobs.motioncorrection.run_patch.run_patch_motion_correction_multi.motionworker.process
  File "cryosparc_master/cryosparc_compute/jobs/motioncorrection/patchmotion.py", line 255, in cryosparc_compute.jobs.motioncorrection.patchmotion.unbend_motion_correction
  File "cryosparc_master/cryosparc_compute/jobs/motioncorrection/patchmotion.py", line 302, in cryosparc_compute.jobs.motioncorrection.patchmotion.unbend_motion_correction
AssertionError: Get rid of patches that are too close to edges

Marking J2/imported/017211296635942485102_FoilHole_20483864_Data_20492038_20492040_20230420_202813_Fractions.tif as incomplete and continuing...