Based on your output shape it looks like you are dealing with e.g. a segmentation use case.
If that’s the case, your target should also provide the pixel-wise class indices.
If you would like to perform a vanilla multi-class classification, your output should have the shape [batch_size, nb_classes].