As far as I can tell, fmriprep finished successfully and the outputs look correct. The bold Niftis, surface files, and confounds exist for all the runs that exist in the BIDS directory (there should be 4, but one is missing run #4). Is there a specific file to check?
This is the complete error:
Traceback (most recent call last):
File "/Users/tkmd/code/nilearn//task_analysis.py", line 329, in <module>
m = model.fit(imgs, events=event, confounds=confound)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tkmd/miniconda3/lib/python3.12/site-packages/nilearn/glm/first_level/first_level.py", line 669, in fit
design = make_first_level_design_matrix(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tkmd/miniconda3/lib/python3.12/site-packages/nilearn/glm/first_level/design_matrix.py", line 419, in make_first_level_design_matrix
matrix, _ = full_rank(matrix)
^^^^^^^^^^^^^^^^^
File "/Users/tkmd/miniconda3/lib/python3.12/site-packages/nilearn/glm/_utils.py", line 174, in full_rank
U, s, V = spl.svd(X, full_matrices=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tkmd/miniconda3/lib/python3.12/site-packages/scipy/linalg/_decomp_svd.py", line 108, in svd
a1 = _asarray_validated(a, check_finite=check_finite)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tkmd/miniconda3/lib/python3.12/site-packages/scipy/_lib/_util.py", line 321, in _asarray_validated
a = toarray(a)
^^^^^^^^^^
File "/Users/tkmd/miniconda3/lib/python3.12/site-packages/numpy/lib/_function_base_impl.py", line 656, in asarray_chkfinite
raise ValueError(
ValueError: array must not contain infs or NaNs
There’s a bunch of irrelevant code in my script, but this is the complete first_level_from_bids
call:
(
models,
models_run_imgs,
models_events,
models_confounds,
) = first_level_from_bids(
bids_dataset,
task_label=task_label,
space_label=space_label,
sub_labels=sub_labels,
derivatives_folder=derivatives_folder,
smoothing_fwhm=5.0,
drift_model=None,
# Add more things to regression strategy
# Set motion threshold to 0.5 mm for task
confounds_strategy=settings["confounds_strategy"],
confounds_motion=settings["confounds_motion"],
confounds_fd_threshold=settings["confounds_fd_threshold"],
# Running settings
# verbose=2,
minimize_memory=False,
# Set these values to None to infer
t_r=None,
slice_time_ref=None,
hrf_model = settings["hrf"],
# job control
# n_jobs=-2
)
I’m not sure what you mean by “always,” but they fail each time i run it; and none of the others (across two projects and three tasks) are dying with this error.
Thanks!