Giulia_Carvalhal:

My ground-truth are grayscale, not normalized and my masks are grayscale in range (0-3) with pixels equal to each class (0=background, 1=tissue1, 2=tissue2, 3=tissue3). In this case, should I make a mapping of the classes?


It seems your target segmentation maps are already properly mapped.
As a quick test could you check the unique values via print(target.unique()) and make sure that only the valid class indices are returned?



 Giulia_Carvalhal:

How can I use the softmax and argmax in the evaluation?


Assuming your model outputs [batch_size, nb_classes, height, width] then preds = torch.argmax(output, dim=1) would give you the predicted class indices.