Week 1 assignment 2 - how do I test out the CNN model for myself?


I recently completed assignment 2 Convolution_model_Application, and I would see for myself how the CNN model in section 4 - The Functional API can predict which number that is on a picture. Therefore I tried to run following:

prediction = conv_model.predict(X_test[0])

This gave an error and did not work. So, how do I feed the model one single picture (from the test set) and get a prediction?


Hi gbjerr,

Make sure you input a tensor that is preprocessed similarly to the way in which X_train was preprocessed and passed into the model in a similar way.