January 2018
Intermediate to advanced
474 pages
10h 23m
English
Let us use the COCO images dataset to retrain the model to fine-tune the classification task. We shall remove the last layer in the Keras model and add our own fully connected layer with softmax activation for 8 classes. We shall also demonstrate freezing the first few layers by setting the trainable attribute of the first 15 layers to False.
# load the vgg modelfrom keras.applications import VGG16base_model=VGG16(weights='imagenet',include_top=False, input_shape=(224,224,3))
We also specify the input_shape in the above code otherwise Keras throws exceptions later.
Read now
Unlock full access