No dashboards are active for the current data set.最新解决
Posted ZSYL
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了No dashboards are active for the current data set.最新解决相关的知识,希望对你有一定的参考价值。
问题描述
使用 TensorBoard 可视化图时,执行启动命令后,无法加载数据:
执行代码:
"""tensorboard"""
import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# 实现一个加法运算
a = tf.constant(11.0)
b = tf.constant(20.0)
# c = a + b
c = tf.add(a, b)
# 获取默认图
g = tf.get_default_graph() # 一段地址空间,tensorflow将它变为对象,里面存有变量数据等
print('获取当前加法运算的图:', g)
# 打印所有操作,张量默认图
print(a.graph)
print(b.graph)
print(c.graph)
'''
op, tensor, session:所在都是默认的图
'''
# 指定一个会话运行tensorflow程序
with tf.Session() as sess:
print(sess.graph)
# 1. 写入到events文件中
file_writer = tf.summary.FileWriter('./tmp/summary/', graph=sess.graph)
c_res = sess.run(c)
print(c_res)
使用 Pycharm 在 .py
文件中右键 Open in Terminal
,进入当前路径的命令窗口,执行如下命令:
tensorboard --logdir='./tmp/summary'
解决方案
搞了半天,最后原来是 --logdir='./tmp/summary'
,生成文件的所在路径,无需加引号。
tensorboard --logdir=./tmp/summary
注意事项
-
--logdir=
后面一定是event.
文件的上一目录. -
TensorBoard 1.12.2 at http://name:6006 (Press CTRL+C to quit)
,如果无法访问,换成:http://locahost:6006
,即可正常。 -
浏览器一定要用 Chrome,因为Tensorflow是谷歌的框架。
-
浏览器访问
URL
时,Terminal 一定不要关闭!
加油!
感谢!
努力!
以上是关于No dashboards are active for the current data set.最新解决的主要内容,如果未能解决你的问题,请参考以下文章