I saved Keras model in hdf5
format as follows:
from keras.callbacks import ModelCheckpoint
filepath="keras_ltsm_dep_model2.hdf5"
checkpointer = ModelCheckpoint(filepath,
monitor='val_acc',
verbose=1,
save_best_only=True,
mode='max')
Then I tried to load this model in another program as follows:
from keras.models import load_model
model = load_model('keras_ltsm_arr_model_081.hdf5')
Then I got the following error:
ImportError: `load_model` requires h5py
How should I load my model saved in hdf5
format?
Did you install h5py
lib?
Try this:
sudo apt-get install libhdf5
sudo pip install h5py
If it's not working, maybe you also need to install cython
as well (you can check if you already have it). If it happens, do: sudo pip install cython