Tensorboard 可视化
Tensor board Visualization
这段代码有什么问题吗,因为这是生成一个里面有 tf 文件的输出文件夹,但是当我试图 运行 它在张量板上显示时 - 没有找到图形定义文件。
import tensorflow as tf
a = tf.add(1, 2,)
b = tf.multiply(a, 3)
c = tf.add(4, 5,)
d = tf.multiply(c, 6,)
e = tf.multiply(4, 5,)
f = tf.div(c, 6,)
g = tf.add(b, d)
h = tf.multiply(g, f)
with tf.Session() as sess:
writer = tf.summary.FileWriter("output", sess.graph)
print(sess.run(h))
writer.close()
两件事。首先,您是否收到任何错误 运行 代码,因为 with: 块中没有缩进。
其次,确保将 Tensorboard 指向正确位置的正确目录。 Tensorboard 中有任何显示吗?
- 确保在您所在的同一目录中有一个
output
目录 运行 该脚本
- 确保里面有一些文件
./output
- 从同一目录启动张量板:
tensorboard —logdir=./output
这段代码有什么问题吗,因为这是生成一个里面有 tf 文件的输出文件夹,但是当我试图 运行 它在张量板上显示时 - 没有找到图形定义文件。
import tensorflow as tf
a = tf.add(1, 2,)
b = tf.multiply(a, 3)
c = tf.add(4, 5,)
d = tf.multiply(c, 6,)
e = tf.multiply(4, 5,)
f = tf.div(c, 6,)
g = tf.add(b, d)
h = tf.multiply(g, f)
with tf.Session() as sess:
writer = tf.summary.FileWriter("output", sess.graph)
print(sess.run(h))
writer.close()
两件事。首先,您是否收到任何错误 运行 代码,因为 with: 块中没有缩进。
其次,确保将 Tensorboard 指向正确位置的正确目录。 Tensorboard 中有任何显示吗?
- 确保在您所在的同一目录中有一个
output
目录 运行 该脚本 - 确保里面有一些文件
./output
- 从同一目录启动张量板:
tensorboard —logdir=./output