Unable to create Vgg16 object (Lesson 1)

When I run vgg = Vgg16(), I get the following error:

Downloading data from http://www.platform.ai/models/vgg16.h5

AttributeError Traceback (most recent call last)
in ()
----> 1 vgg = Vgg16()

/home/ka/course.fast.ai/courses/deeplearning1/nbs_edited/vgg16.pyc in init(self)
31 def init(self):
32 self.FILE_PATH = ‘http://www.platform.ai/models/
—> 33 self.create()
34 self.get_classes()

/home/ka/course.fast.ai/courses/deeplearning1/nbs_edited/vgg16.pyc in create(self)
81 fname = ‘vgg16.h5’
—> 82 model.load_weights(get_file(fname, self.FILE_PATH+fname, cache_subdir=‘models’))

/home/ka/anaconda2/envs/ml-env/lib/python2.7/site-packages/keras/utils/data_utils.pyc in get_file(fname, origin, untar, md5_hash, cache_subdir)
94 try:
95 try:
—> 96 urlretrieve(origin, fpath, dl_progress)
97 except URLError as e:
98 raise Exception(error_msg.format(origin, e.errno, e.reason))

/home/ka/anaconda2/envs/ml-env/lib/python2.7/site-packages/keras/utils/data_utils.pyc in urlretrieve(url, filename, reporthook, data)
33 response = urlopen(url, data)
34 with open(filename, ‘wb’) as fd:
—> 35 for chunk in chunk_read(response, reporthook=reporthook):
36 fd.write(chunk)
37 else:

/home/ka/anaconda2/envs/ml-env/lib/python2.7/site-packages/keras/utils/data_utils.pyc in chunk_read(response, chunk_size, reporthook)
18 def urlretrieve(url, filename, reporthook=None, data=None):
19 def chunk_read(response, chunk_size=8192, reporthook=None):
—> 20 total_size = response.info().get(‘Content-Length’).strip()
21 total_size = int(total_size)
22 count = 0

AttributeError: ‘NoneType’ object has no attribute ‘strip’

I am using Keras 1.1.2 and the Keras.JSON file is using Theano backend as instructed. Also, when I try to manually download the model from http://www.platform.ai/models/vgg16.h5, I am unable to (access denied).

Any help will be appreciated. Thank you.

Hey Kumar,

I suspect your repository is outdated. The links to the models have been changed from platform.ai to files.fast.ai. Take a git pull and it should work. Check this - https://github.com/fastai/courses/blob/master/deeplearning1/nbs/vgg16.py#L46