【发布时间】:2018-12-31 22:59:25
【问题描述】:
我在我的 ML 项目中使用带有 TensorBoard 回调的 keras。我有一个图像自动编码器,我想可视化它在重建一些图像方面的进展。所以我将TensorBoard 类归为这样:
class Monitor(TensorBoard):
def on_train_begin(self, logs=None):
super().on_train_begin(logs)
def on_epoch_begin(self, epoch, logs=None):
# 1. Get the reconstructed images
reconstructions = Autoencoder.predict(validation[0])
# 2. Generate a summary
summary = tf.summary.image('reconstructions', expand_dims(gallery(reconstructions), axis=0), family='reconstructions')
# 3. Add the summary with `epoch` as the step
self.writer.add_summary(summary.eval(), epoch)
super().on_epoch_begin(epoch, logs)
(gallery 函数只是从一批图像中生成单个图像)
运行代码时我在TensorBoard 中看到的是this screenshot。
每张图片都写有不同的名称,TensorBoard 无法使用单个滑块在它们之间切换。
如何编写图像摘要,以便TensorBoard 给我一个滑块来选择不同的步骤?
【问题讨论】:
标签: tensorflow keras visualization tensorboard autoencoder