MIC-DKFZ / nnUNet

Apache License 2.0
5.91k stars 1.76k forks source link

Issue with Medical Segemtnation Decathlon data conversion #1198

Closed josephrich98 closed 1 year ago

josephrich98 commented 2 years ago

I am following the instructions on inference_example_Prostate.md. When I run the following command - nnUNet_convert_decathlon_task -i /home/jrich/Task05_Prostate (with xxx replaced by my path name) - I do not get a syntax or runtime error, but the converted dataset does not save in my nnUNet_raw_data folder.

I am running on a Linux virtual machine (physical machine MacBook Air), I installed PyTorch from the website with conda and CUDA, and I believe all of my paths are set correctly (echo $nnUNet_raw_data_base returns ‘/home/jrich/nnUNetFrame2/dataset/nnUNet_raw_data_base’, echo $nnUNet_preprocessed returns '/home/jrich/nnUNetFrame2/dataset/nnUNet_preprocessed', echo $RESULTS_FOLDER returns ‘/home/jrich/nnUNetFrame2/dataset/nnUNet_trained_models’). I have the dataset folder saved as Task05_Prostate, and have tried moving the location to see if that would make a difference.

Thank you!

Joeycho commented 2 years ago

Hi, Does TaskXXX, exactly with 3 digits? or as the above, Task05?

2 digits might not work..

josephrich98 commented 2 years ago

I originally kept it with Task05 as was in the instructions. Tried replacing it with a 3 digit number (501, as naming instructions recommended numbers between 500-999) and got a different error. Ran the following command:

_nnUNet_convert_decathlon_task -i /home/jrich/nnUNetFrame2/dataset/nnUNet_raw_data_base/nnUNet_raw_data/Task501Prostate

. . .

and received the following error:

_Please cite the following paper when using nnUNet:

Isensee, F., Jaeger, P.F., Kohl, S.A.A. et al. "nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation." Nat Methods (2020). https://doi.org/10.1038/s41592-020-01008-z

If you have questions or suggestions, feel free to open an issue at https://github.com/MIC-DKFZ/nnUNet

Traceback (most recent call last): File "/home/jrich/enter/envs/nn_UNet/bin/nnUNet_convert_decathlon_task", line 33, in sys.exit(load_entry_point('nnunet', 'console_scripts', 'nnUNet_convert_decathlon_task')()) File "/home/jrich/nnUNetFrame2/nnUNet/nnunet/experiment_planning/nnUNet_convert_decathlon_task.py", line 60, in main split_4d(args.i, args.p, args.output_task_id) File "/home/jrich/nnUNetFrame2/nnUNet/nnunet/experiment_planning/utils.py", line 45, in split_4d assert firstunderscore == 6, "Input folder start with TaskXX with XX being a 3-digit id: 00, 01, 02 etc" AssertionError: Input folder start with TaskXX with XX being a 3-digit id: 00, 01, 02 etc

Joeycho commented 2 years ago

https://github.com/MIC-DKFZ/nnUNet/blob/aa53b3b87130ad78f0a28e6169a83215d708d659/nnunet/experiment_planning/utils.py#L44

Ah, I think in your case, you need to stick with 2 digits. Because you create from Decalthon data to nnUNet data format.

Then, you will get the first error, right? maybe you can check put the breakpoint in split4D function, and check what is output_folder name.

josephrich98 commented 2 years ago

output_folder was saved in the following path:

'‘/home/jrich/nnUNetFrame2/dataset/nnUNet_raw_data_base’/nnUNet_raw_data/Task005_Prostate'

I realized the problem was the extra set of single quotes enclosing from the beginning to nnUNet_raw_data_base because I saved these path names using quotes in bashrc, so I resaved these path names without the single quotes and the problem was resolved. Thank you!