Mehrdad-Noori / Brain-Tumor-Segmentation

Attention-Guided Version of 2D UNet for Automatic Brain Tumor Segmentation
207 stars 37 forks source link

Predicted Values all zero #14

Open shaleenanuj opened 3 years ago

shaleenanuj commented 3 years ago

I trained the model and after 22 epoch I tried to predict but the file which come on prediction is all zeros. can you please tell me what is the issue.

zhangshuang317 commented 2 years ago

I encountered the same situation, did you solve this problem?

gyakuz commented 2 years ago

Have you solved it yet,The predict file is not segmented

JiahaoHuang99 commented 2 years ago

I met the same problem. Have you solved it?

JiahaoHuang99 commented 2 years ago

Have you solved it yet,The predict file is not segmented

I found the result changed when I removed the normalize_volume() in predict.py, but the result is still terrible.

You can try it. And if you trained a good model, could you please send me your weight? Thanks.

razeineldin commented 2 years ago

Hi @shaleenanuj, @zhangshuang317, @gyakuz, @JiahaoHuang99,

I faced the same issue and solved it as follows:

The normalization code in normalize_volume() in predict.py has to be the same as the training normalization code.

normalized_slices[..., slice_ix] = normalize_slice(input_volume[..., slice_ix])

Instead of

normalized_slices[slice_ix] = input_volume[slice_ix] for mode_ix in range(input_volume.shape[1]): normalized_slices[slice_ix][mode_ix] = normalize_slice(input_volume[slice_ix][mode_ix])

sneh-debug commented 1 year ago

@shaleenanuj Please tell me the dependency of tensorflow and keras you have installed to run this code?

Coolwen1997 commented 1 year ago

Have you solved it yet,The predict file is not segmented

I found the result changed when I removed the normalize_volume() in predict.py, but the result is still terrible.

You can try it. And if you trained a good model, could you please send me your weight? Thanks.

Sorry to bother you. The segmentation results from the trained model are terrible. And the val_loss is close to 0.9 even in the 30th epoch when I am training. Have you occurred the same problem and how did you solved it ? Thanks