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

TypeError: 'NoneType' object is not iterable #333

Open
vogelbac opened this issue Feb 1, 2022 · 2 comments
Open

TypeError: 'NoneType' object is not iterable #333

vogelbac opened this issue Feb 1, 2022 · 2 comments

Comments

@vogelbac
Copy link

vogelbac commented Feb 1, 2022

Hey I want to start Fitlins created the model but got the error TypeError: 'NoneType' object is not iterable

I am using the docker container :latest
this is the command I use:
sudo docker run --rm -it -v /home/g0rella/Desktop/SFB:/bids:ro -v /home/g0rella/Desktop/SFB/derivatives/fmriprep:/prep:ro -v /home/g0rella/Desktop/SFB/derivatives:/out poldracklab/fitlins:latest /bids /out run -d /prep --model models/model-001_smdl.json --participant-label sub-01

this is the model (model-001_smdl.json) I use:

{
"Name": "two_condition",
"Description": "A simple, two-condition contrast",
"Input": {
"task": "face"
},
"Steps": [
{
"Level": "Run",
"Transformations":[

	    {
	      "Name": "Factor",
	      "Inputs": ["trial_type"]
	    },
	    {
	      "Name": "Convolve",
	      "Model": "spm",
	      "Inputs": ["trial_type.face_fear", "trial_type.face_happy","trial_type.fixation_cross"]
	    }
  	
  	],
  
  "Model":{
  "X": [
    "trial_type.face_fear",
           "trial_type.face_happy",
           "trial_type.fixation_cross",
           "framewise_displacement",
           "trans_x",
           "trans_y",
           "trans_z",
           "rot_x",
           "rot_y",
           "rot_z",
           "a_comp_cor_00",
           "a_comp_cor_01",
           "a_comp_cor_02",
           "a_comp_cor_03",
           "a_comp_cor_04",
           "a_comp_cor_05"]
      },
      "DummyContrasts": {
    "Conditions": ["trial_type.face_fear", "trial_type.face_happy", "trial_type.fixation_cross"],
    "Type": "t"
    },
  "Contrasts": [
    {
      "Name": "fear_vs_fixation",
      "ConditionList": ["trial_type.face_fear", "trial_type.fixation_cross"],
      "Type": "t",
      "Weights": [1, -1]
    }
  ]
},
{
  "Level": "Dataset",
  "DummyContrasts": {
  "Conditions": ["fear_vs_fixation"],
    	"Type": "t"
  		}
  }

]
}

@effigies
Copy link
Collaborator

effigies commented Feb 1, 2022

Hi, can you show the traceback of the error? And at a guess, this might be an issue with an invalid dataset_description.json in either your raw or derivative dataset.

@vogelbac
Copy link
Author

vogelbac commented Feb 2, 2022

For sure here is the traceback. For test reasons I used heudiconv to convert the DICOM data into BIDS and let the dataset_description.json as it was created. After running fmriprep I also let the dataset_description.json at it was. But then an error raised to add "PipelineDescription":{"Name":"Example pipeline"}. So I added this into the fmriprep dataset description. I hope this helps

sudo docker run --rm -it -v /home/g0rella/Desktop/SFB:/bids:ro -v /home/g0rella/Desktop/SFB/derivatives/fmriprep:/prep:ro -v /home/g0rella/Desktop/SFB/derivatives:/out poldracklab/fitlins:latest /bids /out run -d /prep --model models/model-001_smdl.json --participant-label sub-01
Captured warning (<class 'FutureWarning'>): Fetchers from the nilearn.datasets module will be updated in version 0.9 to return python strings instead of bytes and Pandas dataframes instead of Numpy arrays.
220202-09:06:46,5 nipype.utils WARNING:
A newer version (1.7.0) of nipy/nipype is available. You are using 1.6.1
220202-09:06:53,816 nipype.workflow WARNING:
Storing result file without outputs
220202-09:06:53,816 nipype.workflow WARNING:
[Node] Error on "fitlins_wf.loader" (/tmp/tmphu_g7ngp/fitlins_wf/loader)
220202-09:06:54,167 nipype.workflow ERROR:
Node loader failed to run on host e93617da0a13.
220202-09:06:54,168 nipype.workflow ERROR:
Saving crash info to /work/crash-20220202-090654-neuro-loader-89ac0778-5d54-4a9e-b60e-6232f624f8c5.txt
Traceback (most recent call last):
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py", line 148, in init
mp_context=mp_context,
TypeError: init() got an unexpected keyword argument 'initializer'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
result["result"] = node.run(updatehash=updatehash)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 516, in run
result = self._run_interface(execute=True)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 635, in _run_interface
return self._run_command(execute)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 741, in _run_command
result = self._interface.run(cwd=outdir)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 428, in run
runtime = self._run_interface(runtime)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/interfaces/bids.py", line 221, in _run_interface
analysis.setup(drop_na=False, **selectors)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/analysis.py", line 104, in setup
self.finalize(**selectors)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/analysis.py", line 112, in finalize
step.setup(input_contrasts, **kwargs)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/analysis.py", line 282, in setup
colls = tm.TransformerManager().transform(coll, self.transformations)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 458, in transform
func(collection, cols, **kwargs)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 96, in new
t._setup(collection, variables, *args, **kwargs)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 123, in _setup
self._expand_variable_groups()
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 131, in _expand_variable_groups
variables = [groups[v] if v in groups else [v] for v in self.variables]
TypeError: 'NoneType' object is not iterable

220202-09:06:56,163 nipype.workflow ERROR:
could not run node: fitlins_wf.loader
Traceback (most recent call last):
File "/opt/miniconda-latest/envs/neuro/bin/fitlins", line 8, in
sys.exit(main())
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/cli/run.py", line 294, in main
sys.exit(run_fitlins(sys.argv[1:]))
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/fitlins/cli/run.py", line 286, in run_fitlins
analysis.setup(**selectors)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/analysis.py", line 104, in setup
self.finalize(**selectors)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/analysis.py", line 112, in finalize
step.setup(input_contrasts, **kwargs)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/analysis.py", line 282, in setup
colls = tm.TransformerManager().transform(coll, self.transformations)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 458, in transform
func(collection, cols, **kwargs)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 96, in new
t._setup(collection, variables, *args, **kwargs)
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 123, in _setup
self._expand_variable_groups()
File "/opt/miniconda-latest/envs/neuro/lib/python3.6/site-packages/bids/analysis/transformations/base.py", line 131, in _expand_variable_groups
variables = [groups[v] if v in groups else [v] for v in self.variables]
TypeError: 'NoneType' object is not iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants