When I run the jupyter notebook locally on my Mac using keras 2.0, an AttributeError happened as shown below:
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.finetune(batches)
vgg.fit(batches, val_batches, nb_epoch=1)
AttributeError Traceback (most recent call last)
in ()
4 batches = vgg.get_batches(path+‘train’, batch_size=batch_size)
5 val_batches = vgg.get_batches(path+‘valid’, batch_size=batch_size*2)
----> 6 vgg.finetune(batches)
7 vgg.fit(batches, val_batches, nb_epoch=1)
172 See definition for get_batches().
173 """
–> 174 self.ft(batches.nb_class)
175
176 classes = list(iter(batches.class_indices)) # get a list of all the class labels
AttributeError: ‘DirectoryIterator’ object has no attribute ‘nb_class’
I tried to change the ‘nb_class’ in vgg16.py, but still not working.
Could anyone help me out with this?
Many thanks!