【发布时间】:2017-08-17 03:18:07
【问题描述】:
我已经使用sequence_loss定义了我自己的损失函数
loss = tf.contrib.legacy_seq2seq.sequence_loss(logits, labels, weights)
我希望将其添加到 eval_metric_ops 中,以便在我的 ML 引擎包中我可以在 tensorboard 中连续显示评估损失(默认值只是准确性)。我尝试将其添加为自定义 eval_metric_ops
eval_metric_ops = {
'loss': loss # this has already been coputed for Modes.EVAL
}
但是,我收到错误“TypeError:eval_metric_ops 的值必须是 (metric_value, update_op) 元组,给定:Tensor("sequence_loss/truediv:0", shape=(), dtype=float32) for key: loss" -- 我需要做什么才能将损失作为 eval_metric_op 传递?我猜我当前的loss应该是metric值,但是不知道update_op应该是什么?
【问题讨论】:
标签: python tensorflow google-cloud-ml-engine