Hi everyone!
I’m trying to use Cross Entropy as my loss function, but there’s something wrong with dimensions of my output or target that I can’t notice.
Te output of my net is a single channel image with dimension [batch_size, 1, 320, 180]
The target is a single channel image with dimension [batch_size, 1, 320, 180]
Each pixel have values in the range [0,1].
Now I want to feed the CrossEntropyLoss function with them, but I don’t know which are the dimensions they have to have to be accepted by the function, so I’m getting this error:
RuntimeError: expected scalar type Long but found Float
I solved it by passing labels like: label.long()
(I don’t know if this is correct)
But I achieved the loss function to accept my labels.
The problem comes when the loss is always 0 and it does not train
Any idea which could be the problem?