Loading an existing model

In this section, we will load an existing model (VGGNet) in Keras and use it to classify a new image. The code for this section can be found in the Chapter11/vgg_model.R. We will begin by loading the model and looking at its architecture:

> library(keras)> model <- application_vgg16(weights = 'imagenet', include_top = TRUE)> summary(model)_________________________________________________________________________Layer (type)                     Output Shape                 Param # =========================================================================input_1 (InputLayer)             (None, 224, 224, 3)          0 _________________________________________________________________________block1_conv1 (Conv2D)            (None, 224, 224, 64)         1792 _________________________________________________________________________ ...

Get Deep Learning with R for Beginners 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.