Loading the network

You previously loaded Inception V3. The process for this is the same. We will use the mx.load_checkpoint function to instantiate the model from a checkpoint and also load the synset file containing the class names:

using Images, MXNetconst MODEL_NAME = "weights/mobilenet-v2/mobilenet_v2"const MODEL_CLASS_NAMES = "weights/mobilenet-v2/synset.txt"nnet = mx.load_checkpoint(MODEL_NAME, 0, mx.FeedForward);synset = readlines(MODEL_CLASS_NAMES);

The model is loaded and ready to be used for inference! Please pay attention to the load_checkpoint function. MobileNet loads a checkpoint from epoch 0, instead of 1, which is used for Inception V3.

Get Hands-On Computer Vision with Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.