Error during local refinement: "object has no attribute 'seek'"

Hi all,

I encountered an error during local refinement and would appreciate any insights.

====== Initial Model ======

Resampling initial model to specified volume representation size and pixel-size…

----------------------------- Start Iteration 0

====== Starting Refinement Iterations ======

Using Full Dataset (split 3041 in A, 3040 in B)

Using Max Alignment Radius 93.000 (13.806A)

Current alpha values ( 0.41 | 0.81 | 1.00 | 1.30 | 3.05 )

-- THR 1 BATCH 500 NUM 1000 TOTAL 4.3924515 ELAPSED 46.873738 –

Initializing noise model… (2/2)

Processed 6081.000 images in 48.829s.

Computing FSCs…

Done in 1.750s

Computing cFSCs…

Done in 4.846s

Using Filter Radius 86.126 (14.908A) | Previous: 64.200 (20.000A)

Non-uniform regularization with compute option: GPU

Running local cross validation for A …

Local cross validation A done in 103.019s

Running local cross validation for B …

Local cross validation B done in 97.057s

Plotting..

Traceback (most recent call last):
File “cli/run.py”, line 105, in cli.run.run_job
File “cli/run.py”, line 210, in cli.run.run_job_function
File “compute/jobs/local_refine/run_localrefine.py”, line 1240, in compute.jobs.local_refine.run_localrefine.run_local_refine
File “/home/cryosparc2/cryosparc_worker/core/run_context.py”, line 198, in log_plot
return jobs.add_event_log_figure(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/cryosparc2/cryosparc_worker/core/jobs.py”, line 2494, in add_event_log_figure
imgfiles = assets.upload_figure_formats(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/cryosparc2/cryosparc_worker/core/assets.py”, line 167, in upload_figure_formats
upload_figure(figure, project_uid, job_or_session_uid, name, format=format, savefig_kw=savefig_kw)
File “/home/cryosparc2/cryosparc_worker/core/assets.py”, line 144, in upload_figure
file.seek(0, 0) # type: ignore
^^^^^^^^^
AttributeError: ‘NoneType’ object has no attribute ‘seek’

Hello, just wanted to share that I have seen this error as well. I see it with particle stacks that don’t refine to high resolution, and can suppress the error until the final iteration of local refinement by disabling the ‘intermediate_plots’ parameter.

1 Like

Thanks @pey123456 @r-karimi for your reports. We plan to fix this bug and confirm

that disabling the Show plots from intermediate steps parameter is a workaround.

1 Like

Hi Wtempel

I tried this method, but when I continued the process, I encountered the following error. I checked the input, and it appears that the FSC mask is present.

Traceback (most recent call last):
File “cli/run.py”, line 105, in cli.run.run_job
File “cli/run.py”, line 210, in cli.run.run_job_function
File “compute/jobs/align_3D/run.py”, line 66, in compute.jobs.align_3D.run.run_align_3D
File “/home/cryosparc2/cryosparc_worker/core/run_context.py”, line 339, in load_input_connections
return jobs.load_input_connections(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/cryosparc2/cryosparc_worker/core/jobs.py”, line 1809, in load_input_connections
key: load_output(
^^^^^^^^^^^^
File “/home/cryosparc2/cryosparc_worker/core/jobs.py”, line 1971, in load_output
metafile = find_output_result_metafile(job, output_name, result.name, version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/cryosparc2/cryosparc_worker/core/jobs.py”, line 1871, in find_output_result_metafile
raise JobConnectionLoadError(
core.jobs.JobConnectionLoadError: Job P76-J950 (Local Refinement) Refined volume output does not have result mask_fsc_auto with version F

Hi @pey123456,

Did you use “Mark Job as Complete” on any of the upstream local refinements input to this Align 3D Job? If so, can you let us know what happens when you use the indicated workaround from @r-karimi on all local refinements input to the Align 3D job, ensuring that “Mark Job as Complete” was not used on any of these local refinements?

Michael

Hi mmclean,

I used “Mark Job as Complete”

If not use “Mark Job as Complete” , the Align 3D job will wait.

Hi @pey123456 ,

To use the outputs of the local refinement jobs, you will have to re-run them (turning the Intermediate Plots parameter off) and then re-connect them to Align 3D. You cannot use outputs of a failed or killed job downstream.

Michael

Hi Michael

How to reconnect it?

I tried to drag them from outputs, but the align 3d job still wait(waiting because inputs are not ready).

thanks,

Hao

Hi Hao,

Did each of the local refinement jobs complete? What is their current status (i.e. complete, failed, killed, etc.)?

Michael

Hi Michael

All of them are failed.

if turning the Intermediate Plots parameter off, the error will occur at the last round.