Last active
February 17, 2017 22:25
-
-
Save william-r-s/dd372ecdb430eeb8f9f39fb7392b7ce1 to your computer and use it in GitHub Desktop.
tensorflow trace code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensorflow.python.client import timeline | |
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) | |
run_metadata = tf.RunMetadata() | |
sess.run([tensor], options=run_options, run_metadata=run_metadata) | |
# Create the Timeline object, and write it to a json | |
tl = timeline.Timeline(run_metadata.step_stats) | |
ctf = tl.generate_chrome_trace_format() | |
with open('timeline.json', 'w') as f: | |
f.write(ctf) | |
# Open in chrome://tracing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment