ptrblck:

If you are dealing with a multi-class segmentation use case, the targets should have the shape [batch_size, height, width] and contain the class indices in the range [0, nb_classes-1] .
Your target seems to be a channel-last RGB image tensor, which will not work.
If each class in your target uses a specific color code, you would have to convert these color codes to class indices first.


The data set I used is the VOC2007 version. I have checked the label chart, which is all 8-bit single-channel index chart with 21 categories. I have no idea what the problem is