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

ds004302-mriqc: "ValueError: Input X contains NaN" #77

Open
jbwexler opened this issue Sep 26, 2023 · 0 comments
Open

ds004302-mriqc: "ValueError: Input X contains NaN" #77

jbwexler opened this issue Sep 26, 2023 · 0 comments
Labels
mriqc Affects MRIQC

Comments

@jbwexler
Copy link
Collaborator

For 1/71 subjects:

Node: mriqc_wf.anatMRIQC.ComputeIQMs.ComputeQI2
Working directory: /node_tmp/work_dir/mriqc/ds004302_sub-21/mriqc_wf/anatMRIQC/ComputeIQMs/in_file..scratch1..03201..jbwexler..openneuro_derivatives..derivatives..mriqc..ds004302-mriqc..sourcedata..raw..sub-21..anat..sub-21_T1w.nii.gz/ComputeQI2

Node inputs:

air_msk =
in_file =

Traceback (most recent call last):
File "/opt/conda/lib/python3.9/site-packages/mriqc/engine/plugin.py", line 60, in run_node
result["result"] = node.run(updatehash=updatehash)
File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
result = self._run_interface(execute=True)
File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
return self._run_command(execute)
File "/opt/conda/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node ComputeQI2.

Traceback:
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 397, in run
runtime = self._run_interface(runtime)
File "/opt/conda/lib/python3.9/site-packages/mriqc/interfaces/anatomical.py", line 376, in _run_interface
qi2, out_file = art_qi2(imdata, airdata)
File "/opt/conda/lib/python3.9/site-packages/mriqc/qc/anatomical.py", line 488, in art_qi2
kde_skl = KernelDensity(kernel="gaussian", bandwidth=4.0).fit(modelx[:, np.newaxis])
File "/opt/conda/lib/python3.9/site-packages/sklearn/neighbors/_kde.py", line 189, in fit
X = self._validate_data(X, order="C", dtype=DTYPE)
File "/opt/conda/lib/python3.9/site-packages/sklearn/base.py", line 577, in _validate_data
X = check_array(X, input_name="X", **check_params)
File "/opt/conda/lib/python3.9/site-packages/sklearn/utils/validation.py", line 899, in check_array
_assert_all_finite(
File "/opt/conda/lib/python3.9/site-packages/sklearn/utils/validation.py", line 146, in _assert_all_finite
raise ValueError(msg_err)
ValueError: Input X contains NaN.
KernelDensity does not accept missing values encoded as NaN natively. For supervised learning, you might want to consider sklearn.ensemble.HistGradientBoostingClassifier and Regressor which accept missing values encoded as NaNs natively. Alternatively, it is possible to preprocess the data, for instance by us
ing an imputer transformer in a pipeline or drop samples with missing values. See https://scikit-learn.org
/stable/modules/impute.html You can find a list of all estimators that handle NaN values at the following
page: https://scikit-learn.org/stable/modules/impute.html#estimators-that-handle-nan-values

@jbwexler jbwexler added the mriqc Affects MRIQC label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mriqc Affects MRIQC
Projects
None yet
Development

No branches or pull requests

1 participant