Handling custom layers (or other custom objects) in saved models code example
Example: keras load model with custom objects
model = load_model(path,custom_objects={"weighted_loss":weighted_loss})
model = load_model(path,custom_objects={"weighted_loss":weighted_loss})