Thank you so much for replying, and another question came to me that is: if I change criterion from nn.CrossEntropyLoss to Dice( or other criterion functions) the shape of the target is important?
Now I am using nn.CrossEntropyLoss but the output after 500 epochs is not satisfied me and it’s not like the output of papers with same situations, so I thought maybe my code is wrong, so I doubted the size of the target and model. So the size of the Target and the model can cause the problem of not learning?