MIC-DKFZ / nnUNet

Apache License 2.0
5.66k stars 1.71k forks source link

free(): invalid pointer #2500

Open Esther-shi opened 1 week ago

Esther-shi commented 1 week ago

Hi!

I'm getting started with nnUNet and when trying to preprocess my first dataset this happens: The estructures of my data is:

nnUNet_raw_data_base/nnUNet_raw_data/Dataset304_appendicular ├── dataset.json ├── imagesTr │ ├──appendicular_001_0000.nii.gz │ ├── appendicular_002_0000.nii.gz │ ├── ... └── labelsTr ├──appendicular_001.nii.gz ├── appendicular_002.nii.gz ├── ...

My dataset.json is:

{ "channel_names": { "0": "CT" }, "labels": { "background": 0, "Segment_2": 1,
"Segment_3": 2, "Segment_4": 3, "Segment_5": 4 }, "numTraining": 22, "numTest": 3, "file_ending": ".nii.gz" } and my environment variables are set as follows: export nnUNet_raw="/home/shm/totalsegmentator/nnUNet/DATASET/nnUNet_raw/" export nnUNet_preprocessed="/home/shm/totalsegmentator/nnUNet/DATASET/nnUNet_preprocessed/" export nnUNet_results="/home/shm/totalsegmentator/nnUNet/DATASET/nnUNet_results/"

But I get the following error when using the command: nnUNetv2_plan_and_preprocess -d 304 --verify_dataset_integrity

Error: Unexpected labels found in file /home/shm/totalsegmentator/nnUNet/DATASET/nnUNet_raw/Dataset304_appendicular/labelsTr/appendicular_002.nii.gz. Expected: [0, 1, 2, 3, 4] Found: [0. 2. 3. 4. 5.] Error: Unexpected labels found in file /home/shm/totalsegmentator/nnUNet/DATASET/nnUNet_raw/Dataset304_appendicular/labelsTr/appendicular_005.nii.gz. Expected: [0, 1, 2, 3, 4] Found: [0. 2. 3. 4. 5.] ……

(For every single image) So then I tried to change the dataset.json to: { "channel_names": { "0": "CT" }, "labels": { "background": 0, "Segment_1": 1,
"Segment_2": 2, "Segment_3": 3, "Segment_4": 4, "Segment_5": 5 }, "numTraining": 22, "numTest": 3, "file_ending": ".nii.gz" }

Then a big, bad new mistake happened when using the command: nnUNetv2_plan_and_preprocess -d 304 --verify_dataset_integrity: image

Finally I stopped the run

I don't know how to deal with this error please help.

Thank you!

gaojh135 commented 1 week ago

运行这个命令后,nnUNetv2_plan_and_preprocess -d 304 --verify_dataset_integrity,会检查你的标签是否是按0,1,2,3...的顺序, Expected: [0, 1, 2, 3, 4] Found: [0. 2. 3. 4. 5.] 这里就检查到你缺少1的标签,建议最好处理成这种按顺序的。 当然也可以运行,试试这样 nnUNetv2_plan_and_preprocess -d 304