Hi,
Thanks for your response. Below are my responses to your question.


Regarding squeezing the target.
The shape for my model output is [1, 2, 417, 417] and the shape of the target (label) is [1, 1, 417, 417]. The loss function only worked when I squeezed the 0th dimension.


I am a little confused by one of your question
“do you get predictions for both classes?”
did you mean, while training is my network predicting the second label at all? (even if it is not correct))


Yes, I am applying the same transform while evaluating the model. The only transform I am applying is ToTensor().


Thanks for your continued help
Nishanth