I trained my CNN (VGG) through google colab and generated .h5 file. Now problem is, I can predict my output successfully through google colab but when i download that .h5 tr
Wow I, just spent 6 Hours of my life trying to figure this out.. Dmitri posted a solution to this here: I trained a keras model on google colab. Now not able to load it locally on my system.
I'm just basically reposting it here because it worked for me.
This looks like some kind of a serialization bug in keras. If you wrap your load_model with the below CustomObjectScope thingy... all should work..
import keras
from keras.models import load_model
from keras.utils import CustomObjectScope
from keras.initializers import glorot_uniform
with CustomObjectScope({'GlorotUniform': glorot_uniform()}):
model = load_model('imdb_mlp_model.h5')