December 2019
Intermediate to advanced
468 pages
14h 28m
English
Both PyTorch and TensorFlow have pretrained VGG models. Let's see how to use them.
Keras is an official part of TensorFlow 2, therefore, we'll use it to load the model:
import tensorflow as tf# VGG16vgg16 = tf.keras.applications.vgg16.VGG16(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000)# VGG19 vgg19 = tf.keras.applications.vgg19.VGG19(include_top=True, weights='imagenet', input_tensor=None, input_shape=None, pooling=None, classes=1000)
By setting the weights='imagenet' parameter, the network will be loaded with pretrained ImageNet weights (they will be downloaded automatically). You can set include_top to False, which will exclude the fully connected ...
Read now
Unlock full access