Luffy03 / Large-Scale-Medical

[CVPR 2024 Extension] 160K volumes (42M slices) datasets, new segmentation datasets, 31M-1.2B pre-trained models, various pre-training recipes, 50+ downstream tasks implementation
Apache License 2.0
33 stars 5 forks source link

The bug in BRATS #1

Open YiboSun2023 opened 2 days ago

YiboSun2023 commented 2 days ago

After running the code in BRATS21 demo, I wonder why the result of Dice_ET returns the value of nan in the validation part?

Luffy03 commented 2 days ago

Hi, thanks for your attention to our work. Do you mean the codes in https://github.com/Luffy03/Large-Scale-Medical/tree/main/Downstream/monai/BRATS21? Would you please share more details about training?

YiboSun2023 commented 2 days ago
屏幕截图 2024-10-15 142512

Just this code inside. I have altered some parameters inside my parser code, this is the training result. Is it same with your code?

Luffy03 commented 2 days ago

Hi, what parameters have you altered? I am uploading checkpoints and training logs to https://pan.baidu.com/s/1w75cJWoWfCt2FSjMDYl1FA?pwd=r1rp#list/path=%2F. you may have a look.

Luffy03 commented 2 days ago

My training log is as 20240725_073644_90.23.txt

YiboSun2023 commented 2 days ago

I have changed the out_channels into 3, and load the pretraining model as your old version model. Is it true to run this code?

Luffy03 commented 2 days ago

oh no, the out_channels should be 4 (one background class, three foreground classes). please directly use our updated codes and don't change the parameters.

YiboSun2023 commented 2 days ago

ValueError: number of channels for target is neither 1 (without one-hot encoding) nor the same as input, got shape torch.Size([1, 4, 128, 128, 128]) and torch.Size([1, 3, 128, 128, 128]). It happens the Value error when set the out_channels as 4, so what I need to change?

Luffy03 commented 2 days ago

Hi, I cannot understand your problem. Seems you did not use our codes. You need to use the label_transform functions at https://github.com/Luffy03/Large-Scale-Medical/blob/main/Downstream/monai/BRATS21/utils/data_utils.py. The above errors may be caused by wrong label transform. Would you please download the entire repo 'Downstream/monai/BRATS21' for implementation?

Our checkpoints and training logs are uploaded to https://pan.baidu.com/s/1w75cJWoWfCt2FSjMDYl1FA?pwd=r1rp#list/path=%2F now, you may have a look

YiboSun2023 commented 2 days ago

Okey, I will try again. Thank you for your suggestion.

Luffy03 commented 2 days ago

Hi you can find that in https://github.com/Luffy03/Large-Scale-Medical/blob/bf53012f6d3817d8e10f88383df7a2c3bcd595b7/Downstream/monai/BRATS21/utils/data_utils.py#L210. The labels are transformed to 4 channels, so your output_chanels should be 4.

YiboSun2023 commented 2 days ago

Okey, thank you for your kind remind. I am too careless for carrying on reproducing.

Luffy03 commented 2 days ago

No problems! Your attention to our work encourages me a lot! Feel free to raise any issues and I will reply to it as soon as possible. And we would be grateful if you could consider giving us a star if you find our codes useful (^o^)/