在keras中显示或保存中间图像张量

时间:2017-02-17 14:03:43

标签: debugging tensorflow keras

我正在尝试调试自定义丢失函数,我希望可视化目标函数中的中间计算步骤中生成的图像。一个tf_summary_image或一个简单的imshow将是完美的,但如果没有使用正确的feed_dict调用sess.run(),它就无法工作。为简单起见,假设我有:

def custom_objective(y_pred, y_true):
    diff = y_pred - y_true
    #Here I would need something to save and/or show the diff image
    square = K.square(diff)
    #Here I would need something to save and/or show the square image
    mean = K.mean(square, axis=-1)
    return mean

有什么建议吗?

0 个答案:

没有答案