When I request Keras to apply prediction with a fitted model to a new dataset without label like this:
model1.predict_classes(X_test)
it works fine. But when I try to make prediction for only one row, it fails:
model1.predict_classes(X_test[10])
Exception: Error when checking : expected dense_input_6 to have shape (None, 784) but got array with shape (784, 1)
I wonder, why?
numpy.ndarray. So to get just the value you want:q = model.predict(np.array([single_x_test]))[0]– Loisaida Sam Sandberg Jan 08 '19 at 18:31