Lesson 1 error: Vgg16 is not defined


(Peggy) #1

I am getting the below error when running Lesson 1 in the jupyter notebook on Ubuntu. I do see that vgg16.py and vgg16bn.py are in the courses -> deep learning -> nbs subdirectory, along with the lesson 1 notebook. Any ideas? Thanks very much for your help. Peggy

NameError Traceback (most recent call last)
in ()
----> 1 vgg = Vgg16()
2 # Grab a few images at a time for training and validation.
3 # NB: They must be in subdirectories named based on their category
4 batches = vgg.get_batches(path+‘train’, batch_size=batch_size)
5 val_batches = vgg.get_batches(path+‘valid’, batch_size=batch_size*2)

NameError: name ‘Vgg16’ is not defined


(nemanja) #2

The segment above that is the one that imports Vgg16, it should look like

import vgg16; reload(vgg16)
from vgg16 import Vgg16

make sure that cell is run so it actually imports it, then try to run the next section. If you get an error during the import part, then look into why that’s happening.