Get Confusion Matrix From a Keras Multiclass Model Your input to confusion_matrix must be an array of int not one hot encodings.