Answer the question
In order to leave comments, you need to log in
Why does keras complain about the loss function?
there is a keras model that is saved via model.save() This model uses a self-written loss function:
def contrastive_loss(y_true, y_pred):
return K.mean(y_true * K.square(y_pred) + (1 - y_true) * K.square(K.maximum(1 - y_pred, 0)))
model.compile(loss=contrastive_loss, optimizer=rms)
from tensorflow.keras.models import load_model
model = load_model("model.h5")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question