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

nnunetv2.inference crashes on import (No module named 'blosc2') due to buggy acvl_utils release #2589

Closed
joshuacwnewton opened this issue Nov 7, 2024 · 5 comments
Assignees

Comments

@joshuacwnewton
Copy link
Contributor

Traceback:

  File "/home/runner/sct_0.0/spinalcordtoolbox/deepseg/inference.py", line 27, in <module>
    import spinalcordtoolbox.deepseg.nnunet as ds_nnunet
  File "/home/runner/sct_0.0/spinalcordtoolbox/deepseg/nnunet.py", line 13, in <module>
    from nnunetv2.inference.predict_from_raw_data import nnUNetPredictor   # noqa: E402
  File "/home/runner/sct_0.0/python/envs/venv_sct/lib/python3.9/site-packages/nnunetv2/inference/predict_from_raw_data.py", line 22, in <module>
    from nnunetv2.inference.data_iterators import PreprocessAdapterFromNpy, preprocessing_iterator_fromfiles, \
  File "/home/runner/sct_0.0/python/envs/venv_sct/lib/python3.9/site-packages/nnunetv2/inference/data_iterators.py", line 12, in <module>
    from nnunetv2.preprocessing.preprocessors.default_preprocessor import DefaultPreprocessor
  File "/home/runner/sct_0.0/python/envs/venv_sct/lib/python3.9/site-packages/nnunetv2/preprocessing/preprocessors/default_preprocessor.py", line 23, in <module>
    from nnunetv2.preprocessing.cropping.cropping import crop_to_nonzero
  File "/home/runner/sct_0.0/python/envs/venv_sct/lib/python3.9/site-packages/nnunetv2/preprocessing/cropping/cropping.py", line 5, in <module>
    from acvl_utils.cropping_and_padding.bounding_boxes import get_bbox_from_mask, crop_to_bbox, bounding_box_to_slice
  File "/home/runner/sct_0.0/python/envs/venv_sct/lib/python3.9/site-packages/acvl_utils/cropping_and_padding/bounding_boxes.py", line 5, in <module>
    import blosc2
ModuleNotFoundError: No module named 'blosc2'

This is a duplicate of MIC-DKFZ/acvl_utils#2, but I'm re-reporting here just in case anyone else runs into this bug and tries to find it by checking nnUNet's issues.

@NathanMolinier
Copy link

Same problem !

@nis
Copy link

nis commented Nov 8, 2024

Downgrading acvl_utils to version 0.2 gets rid of the initial error, though I haven't run any real work yet. So there might be other problems.
pip install --upgrade acvl_utils==0.2

@elpequeno
Copy link

I did the same thing: downgrading acvl_utils to version 0.2 worked for me. So far all my experiments seem to run.

@ykirchhoff
Copy link
Member

Hi everyone,

from the acvl-utils issue it seems like this should be resolved. Please let me know if there are any further issues.

Best,
Yannick

@jamesobutler
Copy link

jamesobutler commented Dec 9, 2024

Hi @ykirchhoff, nnUNet specifies support for Python 3.9 (https://github.com/MIC-DKFZ/nnUNet/blob/v2.5.1/pyproject.toml#L3), but dependency acvl_utils quietly introduced a dependency of blosc2 in acvl_utils==0.2.1 as described in this issue, and then when the blosc2 dependency was explicitly stated in acvl_utils==0.2.2 it specified blosc2>=3.0.0b4 which requires Python 3.10 or newer (see here). Therefore nnUNet's specification of acvl-utils>=0.2,<0.3 is still problematic for Python 3.9 users. Unfortunately the comment about 0.3 may bring breaking changes was not sufficient, as a patch release of acvl_utils actually brought breaking changes and a drop in python version.

"acvl-utils>=0.2,<0.3", # 0.3 may bring breaking changes. Careful!

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

6 participants