我正在尝试添加自己的图片摘要:
class CustomMonitor(tf.contrib.learn.monitors.BaseMonitor):
def step_begin(self, step):
if step % 1500 == 0:
img = estimator.predict({'x': X})
tf.summary.image('img-' + str(step), img)
def step_end(self, step, output):
pass
# ...
estimator.fit(input_fn=get_input_fn, monitors=[CustomMonitor()])
这会引发错误:
raise RuntimeError("Graph is finalized and cannot be modified.")
RuntimeError: Graph is finalized and cannot be modified.
使用预先制作的估算器时,有什么方法可以将任何内容记录到Tensorboard吗?