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

TraitError: The 'tis' trait of a _BASILCBFInputSpec instance must be a float or a list of items which are a float #196

Closed
LuRoe7 opened this issue Jan 24, 2023 · 6 comments · Fixed by #222
Labels
bug Something isn't working

Comments

@LuRoe7
Copy link

LuRoe7 commented Jan 24, 2023

I am trying to run ASLprep 0.2.8 as a singularity container via Slurm. I use the following command:

singularity run --cleanenv
-B /data/core-psy/data/lroell/hcpold:/data
-B /data/core-psy/data/lroell/output_asl:/out
-B /data/core-psy/data/lroell/wd_asl:/workdir
-B /data/core-psy/data/lroell/tmp_asl:/home/aslprep
--home /home/aslprep
/data/core-psy/data/lroell/aslprep-0.2.8.simg /data/ /out participant
--participant_label HCPOLD0001
--skip-bids-validation
--output-spaces MNI152NLin2009cAsym:res-2
--asl2t1w-init register
--asl2t1w-dof 12
--force-bbr
--scorescrub
--basil
--skull-strip-t1w force
--dummy-vols 10
--verbose
--n_cpus 16
--mem 32000
-w /workdir/ \

After a few seconds it throws an error:

traits.trait_errors.TraitError: The 'tis' trait of a _BASILCBFInputSpec instance must be a float or a list of items which are a float, but a value of array([1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 2.2,2.2, 2.2, 2.2, 2.2, 2.2, 2.2, 2.2, 2.2, 2.2, 2.2, 2.2, 2.7, 2.7,
2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 2.7, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2,
3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7, 3.7,
1.5, 1.5, 1.5, 1.5]) <class 'numpy.ndarray'> was specified.

This array corresponds to the sum of every element of the PostLabelingDelay array and the LabelingDuration of 1.5 sec I specified in the .json files:

"PostLabelingDelay": [0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.22.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,2.2,0.0,0.0,0.0,0.0]
"LabelingDuration": 1.5

It seems like the tis trait of the _BASILCBFInputSpec instance requires a list as input and cannot handle numpy arrays. How do I have to specify the PostLabelingDelay in order to make it a list?

@tsalo tsalo added the bug Something isn't working label Jan 30, 2023
@philjohnston
Copy link

philjohnston commented Feb 27, 2023

I'm also experiencing the same error when trying to run ASLprep 0.2.8 via Singularity on PASL data, but I only have a single 'PostLabelingDelay' value.

The command:
singularity run --cleanenv -B /project/def-rmcintos/pjohns/stroke_BIDS:/base aslprep-latest.simg
--participant-label 10450 --skip_bids_validation --scorescrub --fs-license-file $HOME/license/license.txt
-vvv
/base/NIFTI/
/base/derivatives/
participant

The error:
traits.trait_errors.TraitError: The 'tis' trait of a _BASILCBFInputSpec instance must be a float or a list of items which are a float, but a value of array(1.1) <class 'numpy.ndarray'> was specified.

@philjohnston
Copy link

Thank you for the very quick turnaround on this. Forgive my ignorance about singularity, but will this change take effect if I simply reinstall the singularity image? If not, is there anything else I can do in the meantime? Thanks

@tsalo
Copy link
Member

tsalo commented Feb 28, 2023

It looks like there was an issue deploying to DockerHub, so I just fixed that. You can access the recent changes by pulling the pennlinc/aslprep:unstable Docker image.

@philjohnston
Copy link

Thank you. I tried the same call as above with the aslprep:unstable image, and now receive the following:

230301-15:15:21,481 nipype.workflow IMPORTANT:
         ASLPrep started!
230301-15:15:21,854 nipype.workflow CRITICAL:
         ASLPrep failed: module 'networkx' has no attribute 'to_scipy_sparse_matrix'

This seems to be related to this change to Networkx with version 3.0: https://networkx.org/documentation/latest/release/migration_guide_from_2.x_to_3.0.html#replacing-numpy-scipy-matrices-with-arrays

@tsalo
Copy link
Member

tsalo commented Mar 1, 2023

Thanks. I've opened a new issue about this and will push a fix ASAP.

@tsalo
Copy link
Member

tsalo commented Mar 1, 2023

@philjohnston you should be able to pull the new version of unstable now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants