confusion matrix error “Classification metrics can’t handle a mix of multilabel-indicator and multiclass targets”

Confusion matrix needs both labels & predictions as single-digits, not as one-hot encoded vectors; although you have done this with your predictions using model.predict_classes(), i.e. rounded_predictions = model.predict_classes(test_images, batch_size=128, verbose=0) rounded_predictions[1] # 2 your test_labels are still one-hot encoded: test_labels[1] # array([0., 0., 1., 0., 0., 0., 0., 0., 0., 0.], dtype=float32) So, you should … Read more