May 2020
Beginner to intermediate
430 pages
10h 39m
English
Our next step is to import the TensorFlow libraries. The following code imports the ResNet model weights and preprocessed input, similar to what we did in the last section. We learned about each of these concepts in Chapter 5, Neural Network Architecture and Models:
from tensorflow.keras.applications.resnet50 import ResNet50, preprocess_inputfrom tensorflow.keras.layers import Dense, Activation, Flatten, Dropoutfrom tensorflow.keras.models import Sequential, Modelfrom tensorflow.keras.optimizers import SGD, Adamimg_width, img_height = 224, 224
The code also imports several deep learning parameters, such as Dense (a fully connected layer), Activation, Flatten, and Dropout. We then import the Sequential model ...