ValueError: Expected input batch_size (16) to match target batch_size (64)

In my case it was because I was trying to train as a multi-label classification model by encoding the labels with sklearn’s MultiLabelBinarizer but forgot to set the config parameter for multilabel setting to the model:

model.config.problem_type = “multi_label_classification”

1 Like