I am trying to load a Keras model which was trained on an Azure VM (NC promo). But I am getting the following error.
TypeError: Unexpected keyword argumen
Did you use a custom optimizer?
If so, you can load like this:
model = load_model('my_model_name.h5', custom_objects={
'Adam': lambda **kwargs: hvd.DistributedOptimizer(keras.optimizers.Adam(**kwargs))
})
Alternatively you can load your model with model = load_model('my_model_name.h5', compile=False)
and then add an optimizer and recompile, but that will lose your saved weights.