Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training nnUNetv2 Key Error: 'conv_kernel_sizes' #2322

Closed
milutinovicmarija opened this issue Jun 26, 2024 · 3 comments
Closed

Training nnUNetv2 Key Error: 'conv_kernel_sizes' #2322

milutinovicmarija opened this issue Jun 26, 2024 · 3 comments
Assignees

Comments

@milutinovicmarija
Copy link

milutinovicmarija commented Jun 26, 2024

I encountered the following error while trying to train the model nnUNetv2_train DATASET_ID 3d_fullres 0:

../nunetv2/utilities/plans_handling/plans_handler.py", line 116, in conv_kernel_sizes
return self.configuration['conv_kernel_sizes']
KeyError: 'conv_kernel_sizes'

nnUNetv2_plan_and_preprocess -d DATASET_ID was successfuly completed and nnUNetPlans.json file is present in the nnUNet_preprocessed folder containing different configurations.

There is a key kernel_sizes in nnUnetPlans.json file, but there is no key conv_kernel_sizes.

The following keys are present in the configuration file that is being processed by plans_handler.py:

data_identifier
preprocessor_name
batch_size
patch_size
median_image_size_in_voxels
spacing
normalization_schemes
use_mask_for_norm
resampling_fn_data
resampling_fn_seg
resampling_fn_data_kwargs
resampling_fn_seg_kwargs
resampling_fn_probabilities
resampling_fn_probabilities_kwargs
architecture
batch_dice

@ken011528
Copy link

It maybe because of the version of nnunetv2.

@FabianIsensee
Copy link
Member

Please update to the latest version and rerun nnUNetv2_plan_and_preprocess. Then try again

@jeb2112
Copy link

jeb2112 commented Aug 1, 2024

I had the same error for a completely different yet similar reason, but in a trickier sort of way. It didn't occur during training, but in prediction after training was complete. The situation is that I had been running training on a AWS cloud instance, and was downloading the result to run predictions on my local computer. While setting up the cloud instance, I was installing nnUNetv2 fresh, but on the local computer I was using nnUNetv2 installed almost a year ago. After the first training run, I was able to run predictions locally with the older copy of the nnUNetv2 code from last year. But after the second training run, I was getting the above error. The sole change between the two training runs is that I ran the first one with fold=all, and the second one with 5-fold cross-validation. After I created a new local env with a freshly installed nnUNetv2 on my computer, prediction on the 5-fold validation trained models now worked.

@Karol-G Karol-G closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants