Last active
November 3, 2019 15:19
-
-
Save sborquez/e2d4802e2ec490997da857bd784869c9 to your computer and use it in GitHub Desktop.
Find the bottleneck of your model.
This file contains 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
import tensorflow as tf | |
from tensorflow.python.client import timeline | |
import keras | |
tl = timeline.Timeline(run_metadata.step_stats) | |
ctf = tl.generate_chrome_trace_format() | |
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) | |
run_metadata= tf.RunMetadata() | |
model = ... | |
model.compile(..., options=run_options, run_metadata=run_metadata) | |
model.fit(...) | |
with open("output.json", 'w') as f: | |
f.write(ctf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment