python - No scalar data in tensorboard -
i have been reading tensorboard documentation scalars , have problem presenting in tensorboard.
i have pip install tensorflow in windows 10
my code looks this:
import tensorflow tf = tf.constant(7, name='test_variable') tf.summary.scalar('variable', a) tf.session() sess: tf.summary.filewriter('my_folder', graph=sess.graph) x = tf.global_variables_initializer() sess.run(x)
i see there file in my_folder
in command prompt: tensorboard --logdir=my_folder --port 6006
out:
c:\users\mm>tensorboard --logdir=my_folder --port 6006 starting tensorboard b'54' @ http://desktop-9s2d9vf:6006 (press ctrl+c quit)
when open browser get:
no scalar data found. probable causes: etc. etc.
you need run summary_op
, pass result filewriter
. example:
import tensorflow tf = tf.constant(7, name='test_variable') tf.summary.scalar('variable', a) summary_op = tf.summary.merge_all() tf.session() sess: summary_writer = tf.summary.filewriter('/tmp/summary', graph=sess.graph) x = tf.global_variables_initializer() sess.run(x) summary = sess.run(summary_op) summary_writer.add_summary(summary)
from official documentation:
then, can run merged summary op, generate serialized summary protobuf object of summary data @ given step. finally, write summary data disk, pass summary protobuf
tf.summary.filewriter
.
Comments
Post a Comment