November 2017
Intermediate to advanced
304 pages
6h 58m
English
We have already created a VGG16 neural network. In this section, we will try to use the pre-trained model to perform the classifications of cars, cats, and dogs to check whether the model has been loaded successfully.
In the nets.py file, we need to replace the current __main__ code with the following code:
import os from utils import debug_print from scipy.misc import imread, imresize if __name__ == "__main__": SAMPLES_FOLDER = "samples_data" with open('%s/imagenet-classes.txt' % SAMPLES_FOLDER, 'rb') as infile: class_labels = map(str.strip, infile.readlines()) inputs = tf.placeholder(tf.float32, [None, 224, 224, 3], name="inputs") outputs = inference(inputs) debug_print.print_variables(tf.global_variables()) ...Read now
Unlock full access