Evaluation and inference

During the training, we can open TensorBoard and look at the plots of the losses and metrics. At the end of the 50th epoch, we get the plots shown in the following screenshot:

The accuracy and loss values on the training set (orange) and validation set (blue). The summary usage and configuration is hidden to the user by Keras.

Moreover, since we have all of the parameters of the model in our model variable, we can try to feed it an image downloaded from the internet and see whether the segmentation works as expected.

Let's suppose that we downloaded the following image from the internet and saved it as "author.jpg" ...

Get Hands-On Neural Networks with TensorFlow 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.