Module 'h5py' has no attribute 'FIle'

I’m running lesson1.ipynb and when it does vgg = Vgg16(), the program return error: module ‘h5py’ has no attribute ‘FIle’

I’m not really sure why this is happening because I have h5py installed although I’m not sure if it’s the correct version

the full error message is the following:

AttributeError Traceback (most recent call last)
in ()
1 #import Vgg16 helper class
----> 2 vgg = Vgg16()

…/utils/ in init(self)

…/utils/ in create(self)

/usr/local/lib/python3.5/dist-packages/keras/engine/ in load_weights(self, filepath, by_name)
2700 “”"
2701 import h5py
-> 2702 f = h5py.File(filepath, mode=‘r’)
2703 if ‘layer_names’ not in f.attrs and ‘model_weights’ in f:
2704 f = f[‘model_weights’]

AttributeError: module ‘h5py’ has no attribute ‘File’

Please check if you have installed h5py from multiple sources. Something like pip or conda. Because there is a chance of mismatch at the time of importing. Check your packages folder in the OS.


Refer to this link for solution.