Recent update of `dynamic_network_architectures` package contains a backward-inc…ompatible change. `ResidualEncoderUNet` class is in a different module now:
In `dynamic_network_architectures` version 0.2:
from dynamic_network_architectures.architectures.unet import ResidualEncoderUNet
In `dynamic_network_architectures` version 0.4:
from dynamic_network_architectures.architectures.residual_unet import ResidualEncoderUNet
This change breaks nnunet, which breaks totalsegmentator.
Could you update totalsegmentator requirements specification to avoid this incompatible `dynamic_network_architectures` version until the issue is properly sorted out? For a proper solution, maintainers of nnunet and dynamic_network_architectures need to talk.
Full stack trace:
```
Traceback (most recent call last):
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Scripts\TotalSegmentator.exe\__main__.py", line 7, in <module>
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\totalsegmentator\bin\TotalSegmentator.py", line 127, in main
totalsegmentator(args.input, args.output, args.ml, args.nr_thr_resamp, args.nr_thr_saving,
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\totalsegmentator\python_api.py", line 293, in totalsegmentator
seg_img, ct_img = nnUNet_predict_image(input, output, task_id, model=model, folds=folds,
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py", line 375, in nnUNet_predict_image
nnUNetv2_predict(tmp_dir, tmp_dir, tid, model, folds, trainer, tta,
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py", line 178, in nnUNetv2_predict
predict_from_raw_data(dir_in,
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\nnunetv2\inference\predict_from_raw_data.py", line 159, in predict_from_raw_data
load_what_we_need(model_training_output_dir, use_folds, checkpoint_name)
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\nnunetv2\inference\predict_from_raw_data.py", line 96, in load_what_we_need
trainer_class = recursive_find_python_class(join(nnunetv2.__path__[0], "training", "nnUNetTrainer"),
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\nnunetv2\utilities\find_class_by_name.py", line 12, in recursive_find_python_class
m = importlib.import_module(current_module + "." + modname)
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\nnunetv2\training\nnUNetTrainer\nnUNetTrainer.py", line 51, in <module>
from nnunetv2.utilities.get_network_from_plans import get_network_from_plans
File "C:\Users\Logan\AppData\Local\slicer.org\Slicer 5.6.1\lib\Python\Lib\site-packages\nnunetv2\utilities\get_network_from_plans.py", line 1, in <module>
from dynamic_network_architectures.architectures.unet import PlainConvUNet, ResidualEncoderUNet
ImportError: cannot import name 'ResidualEncoderUNet' from 'dynamic_network_architectures.architectures.unet'
```