nipreps / mriqc-learn

Learning on MRIQC-generated image quality metrics (IQMs).
Apache License 2.0
6 stars 6 forks source link

`mriqc_clf` T1w classifier not working in mriqc latest release on docker #8

Open YumekaMengjiaLYU opened 3 years ago

YumekaMengjiaLYU commented 3 years ago

Hello,

I am interesting in the T1w classifier function mriqc_clf which seems to be no longer supported in the latest release On my system, container image files for both the latest and second latest version (0.16.1) of MRIQC were downloaded from docker hub.

When I ran the classifier on the latest version singularity exec -H ~/mengjia_space -B ~/mengjia_space:/output ~/mriqc-21.0.0.sif mriqc_clf --load-classifier -X group_T1w.tsv -v I got the error

WARNING: skipping mount of /local/path/to/output: stat /local/path/to/output: no such file or directory
FATAL:   container creation failed: mount /local/path/to/output->/output error: while mounting /local/path/to/output: mount source /local/path/to/output doesn't exist
(base) [rbc@cubic-login5 mengjia_space]$ singularity exec -H ~/mengjia_space -B ~/mengjia_space:/output ~/mriqc-21.0.0.sif mriqc_clf --load-classifier -X group_T1w.tsv -v
Traceback (most recent call last):
  File "/opt/conda/bin/mriqc_clf", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.8/site-packages/mriqc/bin/mriqc_clf.py", line 190, in main
    from ..classifier.helper import CVHelper
  File "/opt/conda/lib/python3.8/site-packages/mriqc/classifier/helper.py", line 19, in <module>
    from sklearn.metrics.scorer import check_scoring
ModuleNotFoundError: No module named 'sklearn.metrics.scorer'

However, when I ran the same command with the second latest (0.16.1) version singularity exec -H ~/mengjia_space -B ~/mengjia_space:/output ~/mriqc_0.16.1.sif mriqc_clf --load-classifier -X group_T1w.tsv -v, I was able to obtain the output file with prediction labels.

/usr/local/miniconda/lib/python3.7/site-packages/sklearn/utils/__init__.py:4: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Sequence
/usr/local/miniconda/lib/python3.7/site-packages/sklearn/ensemble/weight_boosting.py:29: DeprecationWarning: numpy.core.umath_tests is an internal NumPy module and should not be imported. It will be removed in a future NumPy release.
  from numpy.core.umath_tests import inner1d
211112-09:45:37 mriqc.classifier:INFO Results saved as /cbica/projects/RBC/mengjia_space/mclf_run-20211112-094536*

Is it true that mriqc_clf is no longer supported? Thank you so much for your help and feedback!!

effigies commented 2 years ago

This should have been fixed in 55269f8de6389efa4f60373eb40f269c1476e4cd (part of nipreps/mriqc#927). Can you try building your Singularity image on 21.0.0rc2?

Na6262 commented 2 years ago

I ran into the same problem! I tried building the latest mriqc image, but mriqc_clf still didn't work.

Here is the error I got:

Traceback (most recent call last):                                                                                              
            File "/opt/conda/bin/mriqc_clf", line 8, in <module>                                                                          
              sys.exit(main())                                                                                                            
            File "/opt/conda/lib/python3.8/site-packages/mriqc/bin/mriqc_clf.py", line 303, in main                                       
              cv_helper = CVHelper(                                                                                                       
            File "/opt/conda/lib/python3.8/site-packages/mriqc/classifier/helper.py", line 200, in __init__                               
              self.load(load_clf)                                                                                                         
            File "/opt/conda/lib/python3.8/site-packages/mriqc/classifier/helper.py", line 716, in load                                   
              from sklearn.externals.joblib import load as loadpkl                                                                        
          ModuleNotFoundError: No module named 'sklearn.externals.joblib'

If I use version 0.16.0 instead, I can get a similar output file as Mengjia. However, here rises a question: since my IQMs were computed by version 21.0.0rc2, can I trust the prediction I got from version 0.16.0?

oesteban commented 2 years ago

The MRIQC classifier aged pretty badly. We have outsourced it to the nipreps/mriqc-learn package, where I'm also moving this issue for reference.