When I started fmriprep using the docker command, I couldn't resolve error "AttributeError: type object 'loggers' has no attribute 'warning'"

When I executed the following command, I encountered the error shown below and can’t resolve it. I would appreciate any advice.
The data is validated and I used fmriprep-docker 20.2.0

`> docker run -ti --rm `
>>   -v C:/Users/natakegami/fmriprep/Nifti:/input `
>>   -v C:/Users/natakegami/fmriprep/output:/output `
>>   -v C:/Users/natakegami/fmriprep/license.txt:/license `
>>   poldracklab/fmriprep:latest `
>>   /input /output participant `
>>   --participant-label sub-2023 `
>>   --fs-license-file /license `
>>   --skip-bids-validation `
>>   --n-cpus 4 `
>>   --fs-no-reconall`

-----------

`Unable to find image 'poldracklab/fmriprep:latest' locally
latest: Pulling from poldracklab/fmriprep
0a01a72a686c: Pulling fs layer
cc899a5544da: Pulling fs layer
19197c550755: Pulling fs layer
716d454e56b6: Pull complete
b5bf898e214a: Pull complete
42da0942cc0e: Pull complete
14f5757104e9: Pull complete
611fe4f705a5: Pull complete
ac0b78389510: Pull complete
9e499ad45d56: Pull complete
d9fe4a797d63: Pull complete
0096e55d11c8: Pull complete
8edcf0ca7093: Pull complete
4d1c726a5a26: Pull complete
6a13c4f0f499: Pull complete
4041fab309df: Pull complete
76cb4738a4de: Pull complete
9f64cb20b123: Pull complete
59feaf5d0228: Pull complete
bf2e5cea3f0a: Pull complete
b4ba13fe1476: Pull complete
31a70e08417a: Pull complete
fdd6ba96cc6b: Pull complete
39bb0bc52b4b: Pull complete
8d4583aa23d3: Pull complete
4ac066736182: Pull complete
378885e5b53c: Pull complete
Digest: sha256:4dafc01ffe3f36c9bc5557dfe6fc3dc6ec38b046cd6c41c34a958474096cef8a
Status: Downloaded newer image for poldracklab/fmriprep:latest
/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/validation.py:46: UserWarning: The ability to pass arguments to BIDSLayout that control indexing is likely to be removed in future; possibly as early as PyBIDS 0.14. This includes the `config_filename`, `ignore`, `force_index`, and `index_metadata` arguments. The recommended usage pattern is to initialize a new BIDSLayoutIndexer with these arguments, and pass it to the BIDSLayout via the `indexer` argument.
  warnings.warn("The ability to pass arguments to BIDSLayout that control "
You are using fMRIPrep-20.2.0, and a newer version of fMRIPrep is available: 23.1.4.
Please check out our documentation about how and when to upgrade:
https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading
WARNING: Version 20.2.0 of fMRIPrep (current) has been FLAGGED
(reason: Functional outputs in standard space can be wrong depending on the original data's orientation headers - see https://github.com/nipreps/fmriprep/issues/2307).
That means some severe flaw was found in it and we strongly
discourage its usage.
231104-02:12:05,474 nipype.workflow IMPORTANT:

    Running fMRIPREP version 20.2.0:
      * BIDS dataset path: /input.
      * Participant list: ['2023'].
      * Run identifier: 20231104-021202_30bb688c-f490-4c00-a7d3-eea8b5e54c8c.
      * Output spaces: MNI152NLin2009cAsym:res-native.
      * Pre-run FreeSurfer's SUBJECTS_DIR: /output/freesurfer.
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/workflow.py", line 84, in build_workflow
    retval["workflow"] = init_fmriprep_wf()
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 64, in init_fmriprep_wf
    single_subject_wf = init_single_subject_wf(subject_id)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 304, in init_single_subject_wf
    func_preproc_wf = init_func_preproc_wf(bold_file)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/base.py", line 167, in init_func_preproc_wf
    config.loggers.warning(
AttributeError: type object 'loggers' has no attribute 'warning'`

Hi @Naoki-Take and welcome to neurostars!

Please use the nipreps/fmriprep container instead. Also, you should specify a working directory with the -w argument and not use the fs-no-reconall argument.

Best,
Steven

Thank you for your instruction!!
nipreps/fmriprep seems worked!

But I ran below.
> docker run -ti --rm

-v C:/Users/natakegami/fmriprep/Nifti:/input -v C:/Users/natakegami/fmriprep/output:/output
-v C:/Users/natakegami/fmriprep/license.txt:/license poldracklab/fmriprep:latest
/input /output participant --participant-label sub-2023
–fs-license-file /license --skip-bids-validation
–n-cpus 4 --fs-no-reconall

①If I include --fs-no-reconall, the output of the run is incorrect?

②Also, Is the usage for the -w argument, -w + absolute path to the working directory ?
(e.g. -w C:/Users/natakegami/fmriprep/Nifti)

Thank you for your kind support.

Hi @Naoki-Take

Can you explain more what you mean by this? Are you getting something that looks wrong without that flag?

Yes, but you should make sure that the working directory is separate from your BIDS input directory, and that your working directory is mounted with the -v argument like your other drives in the beginning of the docker command.

Best,
Steven

Thank you for your reply.
I heard that if I don’t include the —fs-no-reconall argument, reconstruction will be done by FreeSurfer, and the output will be clearer.
Is my understanding correct?

Hi @Naoki-Take,

Without that argument, the surface reconstruction pipeline will be run which tends to improve spatial normalization, as well as enables surface outputs if you are interested in those.

Best,
Steven

I hope this finds you well. Just to clarify, are you suggesting that the best approach would be something like below?
For the ‘working’ directory, can I specify it with -v C:/Users/natakegami/fmriprep/work:/work to mount it successfully?
Thank you!

docker run -ti --rm -v C:/Users/natakegami/fmriprep/Nifti:/input
-v C:/Users/natakegami/fmriprep/output:/output -v C:/Users/natakegami/fmriprep/license.txt:/license
-v C:/Users/natakegami/fmriprep/work:/work nipreps/fmriprep:latest
/input /output participant --participant-label sub-2023
–fs-license-file /license --skip-bids-validation
–n-cpus 4 `

Hi @Naoki-Take,

Your command below does not have the working directory specified. You need to both mount it in the docker preamble and specify that drive as the working directory in the fmriprep argument with the -w argument.

Best,
Steven