【发布时间】:2020-08-01 21:30:09
【问题描述】:
我的模型看起来像
Keras 中的单输出多个损失函数:https://stackoverflow.com/a/51705573/9079093
model = Model(inputs=[sketch_inp, color_inp], outputs=disc_outputs)
opt = Adam(lr=learning_rate, beta_1=.5)
model.compile(loss=lambda y_true, y_pred : tf.keras.losses.binary_crossentropy(y_true, y_pred) + \
pixelLevelLoss_weight * pixelLevelLoss(y_true, y_pred) + \
totalVariationLoss_weight * totalVariationLoss(y_true, y_pred) + \
featureLevelLoss_weight * featureLevelLoss(y_true, y_pred),\
optimizer=opt)
保存模型后,我想加载它并完成训练,但我不知道如何使用此自定义损失函数加载它
【问题讨论】:
标签: python tensorflow keras loss