I am building a CNN model with Keras and tensorflow backend. I've trained the model for 6 hours. Now, I want to predict my custom external image using my model. How to do that in Keras? Thank you
1 Answer
To simplify, you could say there is usually 4 main steps when working with models (not just in Keras) :
- building the model and compiling it : model.compile()
- training the model with your training data : model.fit()
- evaluating the model with your test data : model.evaluate()
- making predictions with your target data : model.predict()
Depending on which output you need, you will have to use model.predict_proba() or model.predict_classes().
See https://keras.io/models/sequential/#sequential-model-methods for complete reference and arguments.
Keras repository has also plenty of examples : https://github.com/fchollet/keras/tree/master/examples