Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TensorFlow,TensorBoard:未找到标量数据_Tensorflow_Tensorboard - Fatal编程技术网

TensorFlow,TensorBoard:未找到标量数据

TensorFlow,TensorBoard:未找到标量数据,tensorflow,tensorboard,Tensorflow,Tensorboard,我在想如何操作张力板 我在这里看了演示: 它在我的笔记本电脑上运行良好 这对我来说很有意义 因此,我编写了一个简单的tensorflow演示: # tensorboard_demo1.py import tensorflow as tf sess = tf.Session() with tf.name_scope('scope1'): y1 = tf.constant(22.9) * 1.1 tf.scalar_summary('y1 scalar_summary', y1)

我在想如何操作张力板

我在这里看了演示:

它在我的笔记本电脑上运行良好

这对我来说很有意义

因此,我编写了一个简单的tensorflow演示:

# tensorboard_demo1.py

import tensorflow as tf

sess = tf.Session()

with tf.name_scope('scope1'):
  y1 = tf.constant(22.9) * 1.1
  tf.scalar_summary('y1 scalar_summary', y1)

train_writer = tf.train.SummaryWriter('/tmp/tb1',sess.graph)

print('Result:')
# Now I should run the compute graph:
print(sess.run(y1))

train_writer.close()

# done
它似乎运行正常

接下来,我运行了一个简单的shell命令:

tensorboard --log /tmp/tb1
它告诉我浏览0.0.0.0:6006

我做到了

网页告诉我:

未找到标量数据

如何增强演示,使其记录tensorboard将向我显示的标量摘要?

您必须调用以向日志添加一些数据。例如,一种常见模式用于创建一个张量,该张量隐式地包含当前图形中创建的所有摘要中的信息:

# Creates a TensorFlow tensor that includes information from all summaries
# defined in the current graph.
summary_t = tf.merge_all_summaries()

# Computes the current value of all summaries in the current graph.
summary_val = sess.run(summary_t)

# Writes the summary to the log.
train_writer.add_summary(summary_val)
tf.merge\u all\u summaries()
现在是
tf.summary.merge\u all()