Skip to content

Instantly share code, notes, and snippets.

@xsqian
Created March 15, 2018 06:26
Show Gist options
  • Save xsqian/8d1ced80996c153d1415fc4b16ba4e79 to your computer and use it in GitHub Desktop.
Save xsqian/8d1ced80996c153d1415fc4b16ba4e79 to your computer and use it in GitHub Desktop.
Saving Graphs for TensorBoard
import tensorflow as tf
x = tf.constant(5, name='x')
y = tf.constant(8, name='y')
z = tf.Variable(2*x+3*y, name='z')
model = tf.global_variables_initializer()
with tf.Session() as sess:
write = tf.summary.FileWriter("./tf_logs", sess.graph)
sess.run(model)
print('z = ', sess.run(z)
# launch tensorboard: tensorboard -logdir=./tf_logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment