Hi Luis!



 Luis_Costa:

The shape of logits is: torch.Size([2, 1, 256, 256])
…
I tried to use logits[0] with softmax but now the results is always the same:
tensor([[[0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039],
         [0.0039, 0.0039, 0.0039,  ..., 0.0039, 0.0039, 0.0039],
...



Note that 0.0039 is equal to 1 / 256 (rounded to two significant digits).
The tensor you are passing to softmax() (presumably logits) consists
of elements that all have the same value (at least along the dimension
across which you compute softmax()).  So softmax() says that each
of your 256 classes has the same probability, namely 1 / 256.
Best.
K. Frank