Error when using loaded Keras classifier with custom metrics function
Do you mean keras.models.load_model(path)? It sounds very strange to have model.load_model(). 
You are probably missing the argument custom_objects = {'roc_auc': roc_auc} in load_model. Keras cannot create a model if it doesn't know what roc_auc means.
I have a keras model, which uses custom function for metrics:
model.compile(optimizer = tf.keras.optimizers.Adam(), loss = 'binary_crossentropy', metrics = ['accuracy', roc_auc])
The function works fine and model behaves as expected. However, when saving the model via model.save() and then loading it via model.load_model(), I get ValueError: Unknown metric function:roc_auc when running following code: model.predict(X). Interestingly this error does not appear when I run the same command again, through command shell, it only occurs during first run. Is this a bug?