How to predict input image with trained model in Keras?

I am creating a CNN model with Keras and endorflow support. I trained the model for 6 hours. Now I want to predict my custom external image using my model. How to do it in Keras? thank you

+5
source share
1 answer

To simplify, we can say that when working with models (not only in Keras) there are usually 4 main steps:

  • building a model and compiling it: model.compile ()
  • training a model with training data: model.fit ()
  • evaluating the model with your test data: model.evaluate ()
  • making forecasts with your target data: model.predict ()

Depending on what result you need, you will have to use model.predict_proba () or model.predict_classes ().

See https://keras.io/models/sequential/#sequential-model-methods for full help and arguments.

The Keras repository also has many examples: https://github.com/fchollet/keras/tree/master/examples

+5
source

Source: https://habr.com/ru/post/1259162/


All Articles