【发布时间】:2017-05-18 03:42:39
【问题描述】:
我现在正在学习 tensorflow,但无法让 tensorboard 工作。我尝试了下面的简单程序,但没有成功。该程序在我使用 tensorboard 代码之前可以运行,但是当我使用 tensorboard 代码时,我收到以下错误:
NameError: name 'tensorboard' is not defined
如有任何帮助,我们将不胜感激。
import tensorflow as tf
a = tf.constant(5, name="input_a")
b = tf.constant(3, name="input_a")
c = tf.multiply(a,b, name="mul_c")
d = tf.add(a,b, name="add_d")
e = tf.add(c,d, name="add_e")
sess = tf.Session()
sess.run(e)
output = sess.run(e)
writer = tf.summary.FileWriter('/tmp/newtest', graph=sess.graph)
print(sess.run(e))
tensorboard --logdir /tmp/newtest
【问题讨论】:
-
是什么让您想到应该在 Python 程序中插入
tensorboard --logdir /tmp/newtest?那不是 Python。这是一个shell命令行。 -
user2357112,,, 非常感谢您的回复...我真的很感激...我所做的所有阅读都没有表明它是一个 shell 命令..我现在正在学习和你真的帮了我在这里..这工作!...非常感谢!!!!
标签: tensorboard