The target for the mentioned criteria does not have a channel dimension, as it’s not one-hot encoded.
Instead it contains the class indices directly, so for a segmentation use case, your target should have the shape [batch_size, height, width].