Closed jhbae1184 closed 7 months ago
I tried to use prepare_data_from_nnUNet.py
for my own dataset, but I found it didn't work well, so I wrote my own binary code, the principle is to save only the labels you need, and all others change to background. It's very simple, you can try it. I'm also happy to provide you with my code.
BTW,there is a bug in train.py
,dice cant print in each epoch,there is only print step dice.I'm really curious about why your loss is nan, but Dice score is not 0.and i fix the dice=0,you can try it.
hope my exp can help u :)
In line 95-96 of the prepare_data_from_nnUNet.py, the conversion is done as follows: gt_arr[gt_arr != idx] = 0 gt_arr[gt_arr != 0] = 1 And the label of background is 0, so I think this is the problem. Hope this can help :)
@adrianzzk @Alexz-7 Thank you for helpful answer :) Got it, i will try and it will be helpful for my problem. Thank you very much !
First, thank you very much for sharing this amazing project and source code. Really helpful for my study !!
Sorry but i have a question about BraTS2021 dataset preprocessing. Can you share the details about preparing BraTS_Val* ??
When i run prepare_data_from_nnUNet.py for my BraTS2021 dataset, every 'background' class data (whose volume is all 0) is skipped so that doesn`t save in the dataset folder.
So i removed the code here in prepare_data_from_nnUNet.py
[ if(volume<10): print("skip", target_img_path) continue ] and run train.py. However it has some problems (suddenly the loss is nan, but Dice score is not 0.)
(I check the gt3D consisted of all 0 values, and not sure but guess this is cause of 'background' data)
So i want to know how to construct BraTS 21 dataset.
Thank you again and hope to get an answer ! (If it is my personal issue, sorry in advance for asking bad question ;)) )