How did you define your target and could you check the min and max values for it?
For a segmentation use case the target should have the shape [batch_size, height, width] and contain the class indices in the range [0, nb_classes-1].