作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 tensorflow 上使用 tflearn 包装器来构建模型,并希望将元数据(标签)添加到结果嵌入可视化中。在运行它之后,有没有办法将 metadata.tsv 文件链接到保存的检查点?
我在检查点摘要的 logdir 中创建了一个projector_config.pbtxt 文件,metadata.tsv 位于同一文件夹中。配置如下所示:
embeddings {
tensor_name: "Embedding/W"
metadata_path: "C:/tmp/tflearn_logs/shallow_lstm/"
}
from tensorflow.contrib.tensorboard.plugins import projector
#with tf.Session() as sess:
config = projector.ProjectorConfig()
# One can add multiple embeddings.
embedding = config.embeddings.add()
embedding.tensor_name = 'Embedding/W'
# Link this tensor to its metadata file (e.g. labels).
embedding.metadata_path = 'C:/tmp/tflearn_logs/shallow_lstm/'
# Saves a config file that TensorBoard will read during startup.
projector.visualize_embeddings(tf.summary.FileWriter('/tmp/tflearn_logs/shallow_lstm/'), config)
最佳答案
我遇到了同样的问题,现在已经解决了:)
基本上,您需要做的就是执行以下 3 个步骤:
ckp_dir
; ckp_dir
; tensorboard --logdir=ckp_dir
并单击嵌入选项卡 embeddings {
tensor_name: "embedding_name"
metadata_path: "metatdata.tsv"
}
sess.run('embedding_name:0')
.但是在projector_config.pbtxt中,我们只需输入
tensor_name: "embedding_name"
.
关于tensorflow - 将 Tensorboard 嵌入元数据链接到检查点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41708106/
我是一名优秀的程序员,十分优秀!