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.