MIC-DKFZ / nnUNet

Apache License 2.0
5.71k stars 1.73k forks source link

ValueError: invalid literal for int() with base 10: '(3,)' #1615

Closed shiblyg closed 1 year ago

shiblyg commented 1 year ago

Hi I am trying to run the nnUNetv2_find_best_configuration and getting this error. the 3d fullre is traind for all five folds and I am able to do the inference too but while I am trying to run the best configurations for the BraTS datasetgetting this error: Traceback (most recent call last): File "/home/msadi002/envs/nnUnet2/lib/python3.10/site-packages/nnunetv2/evaluation/evaluate_predictions.py", line 26, in key_to_label_or_region return int(key) ValueError: invalid literal for int() with base 10: '(3,)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/msadi002/envs/nnUnet2/bin/nnUNetv2_find_best_configuration", line 8, in sys.exit(find_best_configuration_entry_point()) File "/home/msadi002/envs/nnUnet2/lib/python3.10/site-packages/nnunetv2/evaluation/find_best_configuration.py", line 295, in find_best_configuration_entry_point find_best_configuration(dataset_name, model_dict, allow_ensembling=not args.disable_ensembling, File "/home/msadi002/envs/nnUnet2/lib/python3.10/site-packages/nnunetv2/evaluation/find_best_configuration.py", line 103, in find_best_configuration 'result': load_summary_json(join(merged_output_folder, 'summary.json'))['foreground_mean']['Dice'] File "/home/msadi002/envs/nnUnet2/lib/python3.10/site-packages/nnunetv2/evaluation/evaluate_predictions.py", line 54, in load_summary_json results['mean'] = {key_to_label_or_region(k): results['mean'][k] for k in results['mean'].keys()} File "/home/msadi002/envs/nnUnet2/lib/python3.10/site-packages/nnunetv2/evaluation/evaluate_predictions.py", line 54, in results['mean'] = {key_to_label_or_region(k): results['mean'][k] for k in results['mean'].keys()} File "/home/msadi002/envs/nnUnet2/lib/python3.10/site-packages/nnunetv2/evaluation/evaluate_predictions.py", line 31, in key_to_label_or_region return tuple([int(i) for i in splitted]) File "/home/msadi002/envs/nnUnet2/lib/python3.10/site-packages/nnunetv2/evaluation/evaluate_predictions.py", line 31, in return tuple([int(i) for i in splitted]) ValueError: invalid literal for int() with base 10: '' .....It takes 30 s to finish the task.....

Lars-Kraemer commented 1 year ago

Hi @shiblyg , can you please provide more context so we can find out what caused this error? Could you share the dataset.json, the exact commands you used when getting this error as well as which BraTS dataset you are using (year)?

Best, Lars

shiblyg commented 1 year ago

This is the dataset.jason: BraTS 2023 {'channel_names': {'0': 'T1n', '1': 'T1c', '2': 'T2W', '3': 'T2F'}, 'labels': {'background': 0, 'whole tumor': [1, 2, 3], 'tumor core': [2, 3], 'enhancing tumor': [3]}, 'numTraining': 60, 'file_ending': '.nii.gz', 'reference': 'see https://www.synapse.org/#!Synapse:syn25829067/wiki/610863', 'licence': 'see https://www.synapse.org/#!Synapse:syn25829067/wiki/610863', 'regions_class_order': [1, 2, 3], 'dataset_release': '1.0'} command: crun -p ~/envs/nnUnet2 nnUNetv2_find_best_configuration 137 -c 3d_fullres

FabianIsensee commented 1 year ago

I just pushed a fix for this, sorry :-)