milesial / Pytorch-UNet

PyTorch implementation of the U-Net for image semantic segmentation with high quality images
GNU General Public License v3.0
9.01k stars 2.47k forks source link

Trained Check Points not Working #491

Closed HunterTom94 closed 5 months ago

HunterTom94 commented 5 months ago

Hi, I have downloaded the dataset and ran python train.py --amp

There is no error, for 5 times in each epoch, for all epochs, the print out is the same: Validation Dice score: 8.2832759748519e-12

I then ran python predict.py -v -n -m checkpoints/checkpoint_epoch5.pth -i data/imgs/0cdf5b5d0ce1_01.jpg to make one prediction. The output is empty.

When I run python predict.py -v -n -m checkpoints/unet_carvana_scale0.5_epoch2.pth -i data/imgs/0cdf5b5d0ce1_01.jpg (the pretrained model from GitHub), the prediction is correct.

May I ask why I cannot successfully train the U-Net? Thank you for your help!

HunterTom94 commented 5 months ago

running the script without --amp solved the problem python train.py

Does anyone know why?