Skip to content

Instantly share code, notes, and snippets.

@ethanabrooks
Last active March 22, 2017 18:28
Show Gist options
  • Save ethanabrooks/859e24930c885af9b991c4a0bb62ebe4 to your computer and use it in GitHub Desktop.
Save ethanabrooks/859e24930c885af9b991c4a0bb62ebe4 to your computer and use it in GitHub Desktop.
import os
import shutil
from os.path import expanduser
import tensorflow as tf
summ = tf.summary.scalar('rand', tf.random_uniform(()))
summary_path = expanduser('~/tf_summaries')
if os.path.exists(summary_path):
shutil.rmtree(summary_path)
writer = tf.summary.FileWriter(summary_path)
sess = tf.Session()
for i in range(20):
summ_result = sess.run(summ)
writer.add_summary(summ_result, global_step=i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment