MIC-DKFZ / nnUNet

Apache License 2.0
5.72k stars 1.73k forks source link

The problem with training BraTS 2023 dataset #1990

Closed TSbme closed 6 months ago

TSbme commented 7 months ago

I hope to train the data for BraTS 2023. The difference between the data for 2023 and that for 2021 is that for the 2023 data, the label for the enhancing tumor is 3, whereas for the 2021 data, the label for the enhancing tumor is 4. Therefore, I made some modifications to the Dataset137_BraTS21.py file, as shown in the modifications on lines 20 and 25. After processing the data, I preprocessed it and then trained it, but during the training process, I found that the dice for ET (enhancing tumor) was always nan. I don't know why this is happening?

input
TSbme commented 7 months ago

Mi

film-out commented 7 months ago

seg_new is created with np.zeros_like so label 3 (for enhancing tumor) has to be reassigned too which is still missing in your code. seg_new[img_npy == 3] = 3 I had the same nan dice issue for ET and this solved it.

TSbme commented 7 months ago

@film-out Yes, I can train it successfully. Thank you!

liyang19971022 commented 7 months ago

@TSbme Can I ask if training BraTS2023 is fast? Why do I keep stopping at epoch 0

TSbme commented 7 months ago

Hi @liyang19971022, I trained for 1000 epochs. The speed wasn't fast, but it didn't continuously stay at epoch 0. You can check the nnUNet_results folder for the automatically generated training_log_2024_3_8.txt file under that task, to see if it is indeed stuck at 0, or if it's a display issue with the server. If it really is stuck at 0, consider using multiple GPUs for task debugging.

CodeHarcourt commented 7 months ago

Mi

Hello, Are you the train_loss and the val_loss was increasing?

Kobalt93 commented 6 months ago

Hi @TSbme, sorry for getting back to you late, I see that @film-out already suggested the solution. You probably already sat the dataset.json file correctly according to https://github.com/MIC-DKFZ/nnUNet/blob/master/documentation/region_based_training.md hopefully you won't have any problem. @liyang19971022 Could you please open a separate issue for that if it still persists? We need more information to answer your question.