PyTorch Tensorboard 中的投影仪选项卡为空白

Posted

技术标签:

【中文标题】PyTorch Tensorboard 中的投影仪选项卡为空白【英文标题】:Projector tab is blank in PyTorch Tensorboard 【发布时间】:2020-12-21 13:42:54 【问题描述】:

我正在尝试可视化每个时期的嵌入。但是投影仪页面显示了这一点 -

这是页面上的文字 -

No checkpoint was found.

Probable causes:

    No checkpoint has been saved yet. Please refresh the page periodically.
    You are not saving any checkpoint. To save your model, create a tf.train.Saver and save your model periodically by calling saver.save(session, LOG_DIR/model.ckpt, step).

If you’re new to using TensorBoard, and want to find out how to add data and set up your event files, check out the README and perhaps the TensorBoard tutorial.

If you think TensorBoard is configured properly, please see the section of the README devoted to missing data problems and consider filing an issue on GitHub.

为了简化事情,我使用以下内容在我的训练循环中生成嵌入;还是不行。

for e in epochs:
    .
    .
    writer.add_embedding(torch.randn(100, 5), global_step=e)

我在这里错过了什么?

【问题讨论】:

你试过重启 TensorBoard 吗?您的浏览器控制台是否出现任何错误? 是的,我已尝试重新启动控制台。甚至删除了./runs 目录。我已经用浏览器控制台的屏幕截图更新了这个问题。请检查一下。作为参考,Graphs/Scalar/Histogram/Images 都可以。只有嵌入没有。 【参考方案1】:

遇到同样的错误后,我尝试运行嵌入的示例脚本,但它突然起作用了。

我将其缩小为:在添加嵌入之前或之后将任何图像添加到 Tensorboard 使其工作。像这样:

writer.add_image('image', np.ones((3,3,3)), 0)

不确定是什么原因造成的。

【讨论】:

我试过了。不幸的是,对我来说没有用。 import torch; import numpy as np; from torch.utils.tensorboard import SummaryWriter; import tensorboard; import tensorflow; tensorflow.io.gfile = tensorboard.compat.tensorflow_stub.io.gfile; writer = SummaryWriter(); writer.add_image('image', np.ones((3,3,3)), 0); writer.add_embedding(torch.randn(100, 5), global_step=0) 尝试运行这个 MWE 并在重启你的 tensorboard 后选择投影仪

以上是关于PyTorch Tensorboard 中的投影仪选项卡为空白的主要内容,如果未能解决你的问题,请参考以下文章

pytorch中的tensorboard使用

pytorch中的tensorboard使用

pytorch中的tensorboard使用

PyTorch Tensorboard 与文档中的描述不符

在 MESS 中使用 pytorch 的 Tensorboard

如何在 pytorch 中使用 tensorboard 调试器?