BCE loss not working
In a binary segmentation case (for exemple building) one cannot choose "bce" (BinaryCrossEntropy) loss as it fail during training. The error message say:
result type Float can’t be cast to the desired output type Long
It's because masks tensor is always pass as long in Odeon and BCE loss need float tensor. There is an explanation of this behaviour in pytorch forum : multi-label-binary-classification-result-type-float-cant-be-cast-to-the-desired-output-type-long.
To correct this one should pass loss = self.loss(logits, masks.float())
instead of loss = self.loss(logits, masks.long())
but only on bce case.