我正在尝试看到张量板图。 我在tensorflow教程(here)
中使用了示例代码我修改了一点代码。
....
....
cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y_, logits=y_conv))
train_step = tf.train.AdamOptimizer(1e-4).minimize(cross_entropy)
correct_prediction = tf.equal(tf.argmax(y_conv,1), tf.argmax(y_,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
sess.run(tf.global_variables_initializer())
writer = tf.summary.FileWriter("/home/(my_directory)",sess.graph)
for i in range(2000):
batch = mnist.train.next_batch(50)
if i%100 == 0:
train_accuracy = accuracy.eval(feed_dict={x:batch[0], y_: batch[1],keep_prob: 1.0})
print("step %d, training accuracy %g"%(i, train_accuracy))
else :
summary = train_step.run(feed_dict={x: batch[0], y_: batch[1],keep_prob: 0.5})
writer.add_summary(summary,i)
print("test accuracy %g"%accuracy.eval(feed_dict={x: mnist.test.images, y_: mnist.test.labels, keep_prob: 1.0}))
在终端,我输入“tensorboard --logdir =”/ home /(my_directoory)“
然后,在chrome浏览器中,通过端口号6006输入tensorboard。
但是,下面没有图表......我该怎么做才能看到我的图表?