Hi - after installing many unmet dependencies i have a problem after this piece of code:
vgg = Vgg16()
batches = vgg.get_batches(path+'train', batch_size=batch_size)
val_batches = vgg.get_batches(path+'valid', batch_size=batch_size*2)
vgg.fit(batches, val_batches, nb_epoch=1)
I see this error: "IOError: Unable to open file (File signature not found)" with this stack trace:
IOError Traceback (most recent call last)
----> 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)
/home/vlad/0_tensorflow/deeplearning1/nbs/vgg16.pyc in init(self)
36 self.FILE_PATH = 'http://localhost:8888/notebooks/0_tensorflow/deeplearning1/nbs/mymodels/' #Sozdal svoy put
37 #self.FILE_PATH = '/home/vlad/0_tensorflow/deeplearning1/nbs/mymodels/' #Sozdal svoy put
---> 38 self.create()
/home/vlad/0_tensorflow/deeplearning1/nbs/vgg16.pyc in create(self)
87 fname = 'vgg16.h5'
---> 88 model.load_weights(get_file(fname, self.FILE_PATH+fname, cache_subdir='models'))
/home/vlad/0_tensorflow/local/lib/python2.7/site-packages/keras/models.pyc in load_weights(self, filepath, by_name)
692 if h5py is None:
693 raise ImportError('
load_weights requires h5py.')
--> 694 f = h5py.File(filepath, mode='r')
695 if 'layer_names' not in f.attrs and 'model_weights' in f:
696 f = f['model_weights']
/home/vlad/0_tensorflow/local/lib/python2.7/site-packages/h5py/_hl/files.pyc in init(self, name, mode, driver, libver, userblock_size, swmr, **kwds)
270 fapl = make_fapl(driver, libver, **kwds)
--> 271 fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
273 if swmr_support:
/home/vlad/0_tensorflow/local/lib/python2.7/site-packages/h5py/_hl/files.pyc in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
99 if swmr and swmr_support:
100 flags |= h5f.ACC_SWMR_READ
--> 101 fid = h5f.open(name, flags, fapl=fapl)
102 elif mode == 'r+':
103 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx in h5py.objects.withphil.wrapper (/tmp/pip-nCYoKW-build/h5py/_objects.c:2840)()
h5py/_objects.pyx in h5py.objects.withphil.wrapper (/tmp/pip-nCYoKW-build/h5py/_objects.c:2798)()
h5py/h5f.pyx in h5py.h5f.open (/tmp/pip-nCYoKW-build/h5py/h5f.c:2117)()
IOError: Unable to open file (File signature not found)
I found that this error "File signature not found" usually means that file is either corrupted or not in the HDF5 format, but i can change this path in file "vgg16.py":
self.FILE_PATH = 'http://files.fast.ai/models/'
to the something wrong like
self.FILE_PATH = 'http://blablabla.com/models/'
and i see same error "File signature not found". It seems 1-st time i saw my error after installed h5py by this command(because i saw error: "ImportError: "
load_weights requires h5py"):
pip install h5py
Before i installed h5py I used wrong old pathway "http://www.platform.ai/models/" and i saw error: "AttributeError: 'NoneType' object has no attribute 'strip'".
So somebody can help me - how i cane tun or reinstall h5py(or do something else) to fix my problem?