在 docker 上运行 Tensorflow 和 Tensorboard。
我试图编写最简单的代码来演示 tensorboard 的工作原理:
graph = tf.Graph()
with graph.as_default(), tf.device('/cpu:0'):
a = tf.constant(5.0)
b = tf.constant(6.0)
c = a * b
# Enter data into summary.
c_summary = tf.scalar_summary("c", c)
merged = tf.merge_all_summaries()
with tf.Session(graph=graph) as session:
writer = tf.train.SummaryWriter("log/test_logs", session.graph_def)
result = session.run([merged])
tf.initialize_all_variables().run()
writer.add_summary(result[0], 0)
然后我跑了tensorboard --logdir={absolute path to log/test_logs}
,但那里没有列出任何事件。有什么我应该在代码中写不同的东西吗?
请注意,它log/test_logs
确实包含像events.out.tfevents.1459102927.0a8840dee548
.