Hello! Your work is amazing! I have a question with the loss.py. I noticed that the cross entropy loss for semantic segmentation is implemented in the following code:
loss = F.cross_entropy(predict, target, weight=weight, size_average=self.size_average)
In this code, the dimension of predict is [h×w, c] and the dimension of target is [h×w]. I remember that when calculating the cross entropy loss, target and prediction should have the same dimensions.
Maybe my problem is very stupid. This problem really bothers me.
Thank you very much!!
See F.cross_entropy, yon do not need to transform semantic label to one-hot label in Pytorch(implemented in F.cross_entropy funcion), but it's needed when you use Tensorflow.
Hello! Your work is amazing! I have a question with the loss.py. I noticed that the cross entropy loss for semantic segmentation is implemented in the following code:
loss = F.cross_entropy(predict, target, weight=weight, size_average=self.size_average)
In this code, the dimension of predict is [h×w, c] and the dimension of target is [h×w]. I remember that when calculating the cross entropy loss, target and prediction should have the same dimensions. Maybe my problem is very stupid. This problem really bothers me. Thank you very much!!