Custom Loss function in Unet


I am trying to use custom loss function with unet_learner, but it throws error about size of input and target vector. But it runs fine with default loss.

To change loss function : learn.loss_func = CustomLoss()

Any idea what is wrong? I have searched this on pytorch forum as well, but no luck.

1 Like