You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from tensorflow.python.client import timeline
run_metadata = tf.RunMetadata()
out = sess.run(...,
options=tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE),
run_metadata=run_metadata)
trace = timeline.Timeline(step_stats=run_metadata.step_stats)
trace_file = open('timeline.ctf.json', 'w')
trace_file.write(trace.generate_chrome_trace_format())
Then open the file in chrome at chrome://tracing.
TensorFlow Test Case
When tf.test.TestCase is used, the default graph is destroyed before every new test.
If self.test_session is used to create session instead of tf.Session, the session will be cashed and re-used within a single test. This cached session will be destroyed at the end of the test and a new session will be created for a new test.