The new error is raised, e.g. if you are passing a target with an additional dimension (which would be the case for a one-hour encoded target).
For a standard multi-classification use case the model output should have the shape [batch_size, nb_classes], while the target should contain the class indices in the range [0, nb_classes] in the shape [batch_size].