JuliaWolleb / Diffusion-based-Segmentation

This is the official Pytorch implementation of the paper "Diffusion Models for Implicit Image Segmentation Ensembles".
MIT License
284 stars 38 forks source link

NaN values #34

Open saisusmitha opened 1 year ago

saisusmitha commented 1 year ago

@JuliaWolleb 1) Getting nan values in very early stages of training why is that? what might be going wrong? Kindly let me know how to solve the nan issue.

| grad_norm | nan | | loss | nan | | loss_q0 | nan | | loss_q1 | nan | | loss_q2 | nan | | loss_q3 | nan | | mse | nan | | mse_q0 | nan | | mse_q1 | nan | | mse_q2 | nan | | mse_q3 | nan | | param_norm | nan | | samples | 1.25e+05 | | step | 2.09e+04 | | vb | nan | | vb_q0 | nan | | vb_q1 | nan | | vb_q2 | nan | | vb_q3 | nan |

guanzhenghua commented 1 year ago

It seems that you have run this code. Do you use your own data set or brast2020? What is your result like? Can you attach pictures.

saisusmitha commented 1 year ago

@guanzhenghua I have run on brats dataset and one other dataset- but for both I didn't get good output segmentation - I didn't figure out exactly why.

For brats - order of images [ GT, 4 I/p Images] BraTS20_Training_333GT_image100 BraTS20_Training_333input_image100_00 BraTS20_Training_333input_image100_01 BraTS20_Training_333input_image100_02 BraTS20_Training_333input_image100_03

These are output samples BraTS20_Training_333sample_image0_100 BraTS20_Training_333sample_image1_100 BraTS20_Training_333sample_image2_100 BraTS20_Training_333sample_image3_100 BraTS20_Training_333sample_image4_100

For another dataset - lungs dataset - The output is - sample_image_13_ens0 sample_image_13_ens1 sample_image_13_ens2 sample_image_13_ens3 sample_image_13_ens4

I don't know exactly why I am getting extra dots around my segmentation. If you have any idea why let me know. @guanzhenghua @JuliaWolleb any idea where I am going wrong?

guanzhenghua commented 1 year ago

@saisusmitha You preprocessed the final five resulting images and it didn't feel right. Because you just binarized it. Only the mask needs to be binarized, and we don't need to do additional binarization of the mask because the author's code includes this step. image So we just need to slice the four original images one mask input. for example. image image image image image But my training result is not good. If you get a good result, can you reply me. thanks a lot.

saisusmitha commented 1 year ago

@guanzhenghua I think yes, the output segmentations i.e samples include input images too. @JuliaWolleb Can you let us know if this is the case - and if not what can be done?