!nnUNetv2_plan_and_preprocess -d 1: RuntimeError: Background label not declared (remember that this should be label 0!) #2889
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello nnU-Net community,
I am encountering a persistent issue while trying to run
nnUNetv2_plan_and_preprocesson my custom 3D medical image segmentation dataset in Google Colab.The command I am running is:
!nnUNetv2_plan_and_preprocess -d 1 --verify_dataset_integrity`
Initially, I received the error:
RuntimeError: Background label not declared (remember that this should be label 0!)
My setup:
Troubleshooting steps I have already taken:
dataset.json: I have confirmed that thedataset.jsonfile is located at/content/drive/MyDrive/my_colab_project/nnUNet_raw/Dataset001_PancreasCancer/dataset.jsonand its content correctly includes"labels": {"0": "background", "1": "pancreas", "2": "tumor"}. The format matches the documentation.labelsTr/*.nii.gz) and confirmed that the value0is present in every file. I also verified that labels1and2are present in sample files.verify_dataset_integrityflag: The error occurs both with and without the--verify_dataset_integrityflag.--cleanflag: Added--cleanto clear potential cache, but the error persists.int16) before preprocessing; the error still occurred.I am puzzled as to why nnU-Net is throwing the "Background label not declared" or the subsequent
ValueErrorwhen all checks indicate the background label (0) is correctly declared and present in the data.Any insights or suggestions from the community would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions