nnUNet icon indicating copy to clipboard operation
nnUNet copied to clipboard

ValueError: invalid literal for int() with base 10

Open squaresoft2015 opened this issue 3 years ago • 5 comments

When running nnUNet_convert_decathlon_task command, the program stuck at:

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/cloudam/.conda/envs/nnUNet/bin/nnUNet_plan_and_preprocess", line 33, in sys.exit(load_entry_point('nnunet', 'console_scripts', 'nnUNet_plan_and_preprocess')()) File "/home/cloudam/nnUNet/nnunet/experiment_planning/nnUNet_plan_and_preprocess.py", line 100, in main i = int(i) ValueError: invalid literal for int() with base 10: '/home/cloudam/nnUNet_raw/nnUNet_raw_data/Task02_Heart/'

How can I solve this? Does the path need to be set inside the folder of all the source files? Or the path can be set to any location. Now the path is set as follows:

nnUNet_preprocessed=/home/cloudam/nnUNet_preprocessed RESULTS_FOLDER=/home/cloudam/nnUNet_trained_models nnUNet_raw_data_base=/home/cloudam/nnUNet_raw

squaresoft2015 avatar Jan 10 '22 01:01 squaresoft2015

What is the exact command you ran?

FabianIsensee avatar Jan 17 '22 08:01 FabianIsensee

What is the exact command you ran?

nnUNet_convert_decathlon_task -i /my dataset folder/Task04_Hippocampus

squaresoft2015 avatar Jan 18 '22 08:01 squaresoft2015

I just re-downloaded the dataset and ran it on my machine. Works fine :-/ Hard to say what's going on when I cannot reproduce the error Does /my dataset folder/Task04_Hippocampus have imagesTr and labelsTr as subfolders? Is it the original dataset as downloaded from medicaldecathlon.org?

FabianIsensee avatar Jan 18 '22 09:01 FabianIsensee

The Task04 folder does contain imagesTs and imagesTr subfolders. Anyway, I will try to download the dataset again and check the md5 checksum.

squaresoft2015 avatar Jan 20 '22 03:01 squaresoft2015

let me know how it goes :-)

FabianIsensee avatar Jan 20 '22 07:01 FabianIsensee

Hi @FabianIsensee I'm getting the same error "ValueError: invalid literal for int() with base 10: 'set002'" while running the command : nnUNetv2_convert_MSD_dataset -i dataset/nnUNet_raw/Dataset002_Heart

devamsheth21 avatar Aug 13 '23 00:08 devamsheth21

Hi @devamsheth21 , the -i already points to a nnUNet Dataset, this raises this error. From the documentation using nnUNetv2_convert_MSD_dataset -h: -i I Downloaded and extracted MSD dataset folder. CANNOT be nnUNetv1 dataset! Example: /home/fabian/Downloads/Task05_Prostate

This means in your case the command should look something like this, where Task02_Heart is the folder you downloaded from the MSD website: nnUNetv2_convert_MSD_dataset -i .../Downloads/Task02_Heart

Best, Lars

Lars-Kraemer avatar Aug 14 '23 08:08 Lars-Kraemer