MIC-DKFZ / nnUNet

Apache License 2.0
5.9k stars 1.76k forks source link

nnUNetTrainer_DASegOrd0_NoMirroring error on nnunetv2==2.5.1 #2480

Open yw7 opened 2 months ago

yw7 commented 2 months ago

When attempting to run nnUNetv2_train with the nnUNetTrainer_DASegOrd0_NoMirroring trainer, the process crashes due to a KeyError in one of the background workers.

With the following command:

nnUNetv2_train.exe 100 3d_fullres 0 -tr nnUNetTrainer_DASegOrd0_NoMirroring

Error Message:

Exception in background worker 0:
 'image'
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\batchgenerators\dataloading\nondet_multi_threaded_augmenter.py", line 55, in producer
    item = transform(**item)
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\batchgeneratorsv2\transforms\base\basic_transform.py", line 18, in __call__
    return self.apply(data_dict, **params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\batchgeneratorsv2\transforms\utils\compose.py", line 13, in apply
    data_dict = t(**data_dict)
                ^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\batchgeneratorsv2\transforms\base\basic_transform.py", line 17, in __call__
    params = self.get_parameters(**data_dict)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Local\Programs\Python\Python311\Lib\site-packages\batchgeneratorsv2\transforms\spatial\spatial.py", line 58, in get_parameters
    dim = data_dict['image'].ndim - 1
          ~~~~~~~~~^^^^^^^^^
KeyError: 'image'

Is the nnUNetTrainer_DASegOrd0_NoMirroring trainer compatible with nnUNetv2 2.5.1?

Any assistance in resolving this issue would be greatly appreciated. Thank you!

fitzjalen commented 2 months ago