简体   繁体   English

在张量板中显示内容不起作用

[英]display content in tensorboard doesn't work

please help!请帮忙! I am new in using tensorboard, and been trying to use to vizualize the metrics of my model but I get some werid error So I used a simple code of tensorboard from here : https://www.easy-tensorflow.com/tf-tutorials/basics/introduction-to-tensorboard , but still getting the same error, which is when I run the command line tensorboard --logdir="./graphs" to vizualize the board, I get the local @ but it contains nothing.我是使用 tensorboard 的新手,并一直试图用来对我的模型的指标进行可视化,但我遇到了一些奇怪的错误所以我从这里使用了一个简单的 tensorboard 代码: https ://www.easy-tensorflow.com/tf- tutorials/basics/introduction-to-tensorboard ,但仍然出现相同的错误,即当我运行命令行 tensorboard --logdir="./graphs" 来可视化板时,我得到了本地 @ 但它不包含任何内容。 As when I go and check the content of the created log file, this is all i find : enter image description here import tensorflow as tf tf.reset_default_graph() # To clear the defined variables and operations of the previous cell当我去检查创建的日志文件的内容时,我发现只有这样: enter image description here import tensorflow as tf tf.reset_default_graph() # 清除前一个单元格的定义变量和操作

# create graph
a = tf.constant(2)
b = tf.constant(3)
c = tf.add(a, b)

# creating the writer out of the session
# writer = tf.summary.FileWriter('./graphs', tf.get_default_graph())

# launch the graph in a session
with tf.Session() as sess:
    # or creating the writer inside the session
    writer = tf.summary.FileWriter('./graphs', sess.graph)
    print(sess.run(c))

I just guess...我只是猜...

.# creating the writer out of the session .# 在会话之外创建作者

.# writer = tf.summary.FileWriter('./graphs', tf.get_default_graph()) >> Is it necessary to create it? .# writer = tf.summary.FileWriter('./graphs', tf.get_default_graph()) >> 有必要创建吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM