Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing in

  Enroll Now

Cats vs Non-cats using Transfer Learning - Getting Pre-Trained VGG16 base model

The trained VGG16 model is available with tensorflow.keras.applications. We have imported this as from tensorflow.keras.applications import VGG16 in the Import Modules section.

Now let us see how we could use.

  • Write the following code to get the weights of the pre-trained VGG16 model.

    vgg_base = VGG16(weights='imagenet', include_top=False)


  • We have got an instance of the VGG16 model which is trained on 'imagenet' data.

  • Since we want to customize it for our purpose of cat-vs-noncat classification, we remove the top layers which are the dense layers.

  • We put the vgg_base layers are not trainable by setting vgg_base to False, so that we could use the same weights of the Convolutional layers as used in the VGG16 imagenet data.

No hints are availble for this assesment

Answer is not availble for this assesment

Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...