Dice Loss for Binary Segmentation with Dynamic U-Net

I’ve been facing some problems in trying to get the PyTorch implementation of Dice Loss working with the Dynamic U-Net. It seems to me that the shapes of output and the ground truths don’t match (for binary segmentation atleast). Can someone please help me with an implementation of the Dice Loss that works with the U-Net?

1 Like