Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set values in GIFTI data array loaded from file #746

Closed
ldaumail opened this issue Apr 1, 2019 · 1 comment
Closed

Cannot set values in GIFTI data array loaded from file #746

ldaumail opened this issue Apr 1, 2019 · 1 comment
Labels
Milestone

Comments

@ldaumail
Copy link

ldaumail commented Apr 1, 2019

Dear numpy experts,

I am running fmriprep on singularity with a version 3.01 image

and my whole 76 subjects dataset run in parallel are crashing on our HPC and give this error message:

"
Node:
fmriprep_wf.single_subject_109_wf.func_preproc_ses_1_task_restingstate_wf.bold_surf_wf.medial_nans
Working directory: /mnt/data/loic2/work/fmriprep_wf/single_subject_109_wf/func_preproc_ses_1_task_restingstate_wf/bold_surf_wf/_hemi_rh/medial_nans

Node inputs:

in_file = ['/mnt/data/loic2/work/fmriprep_wf/single_subject_109_wf/func_preproc_ses_1_task_restingstate_wf/bold_surf_wf/_hemi_rh/sampler/mapflow/_sampler0/rh.fsaverage5.gii']
subjects_dir =
target_subject = ['fsaverage5']

Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
result['result'] = node.run(updatehash=updatehash)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 473, in run
result = self._run_interface(execute=True)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 1253, in _run_interface
self.config['execution']['stop_on_first_crash'])))
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 1128, in _collate_results
for i, nresult, err in nodes:
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/utils.py", line 99, in nodelist_runner
result = node.run(updatehash=updatehash)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 473, in run
result = self._run_interface(execute=True)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 557, in _run_interface
return self._run_command(execute)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 637, in _run_command
result = self._interface.run(cwd=outdir)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 369, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/freesurfer.py", line 328, in _run_interface
newpath=runtime.cwd)
File "/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/freesurfer.py", line 463, in medial_wall_to_nan
darray.data[medial] = np.nan
ValueError: assignment destination is read-only
"
Would you know how to fix it?
It looks like there was a modification of numpy, isn't it?

Thanks in advance for your help!

@effigies
Copy link
Member

effigies commented Apr 1, 2019

This looks like it's related to numpy/numpy#11739, #697, #700, #702.

GIFTI data arrays are being built with base64.b64decode and zlib.decompress, which return bytes objects instead of bytearray, so they're not writable. We'll need to try to figure out a way to create these arrays without doubling memory.

On the other hand, GIFTI darrays are one-per-timestep, so the cost of copying to bytearrays would be time more than memory, so that might be not be too bad.

The quick fix will be to use numpy 1.15.x until we can fix this.

@effigies effigies changed the title fmriprep on singularity crash due to numpy change Cannot set values in GIFTI data array loaded from file Apr 1, 2019
@effigies effigies added this to the 2.4.1 milestone Apr 2, 2019
@effigies effigies added the bug label Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants