Thank you for your reply 
yes, actually when i tried it just gives me 0
do you think that my model UNET (network) is wrong ??
knowing that I initialized the weights which corresponds to the 4 labels and I introduced them to the loss as well
weights = torch.tensor([0.04,0.32,0.32,0.32]).to(device)
criterion = nn.CrossEntropyLoss(weights)
sorry to bother you, i got a little lost, thanks again !!!