diff --git a/eda/esmm/Model_pipline/train.py b/eda/esmm/Model_pipline/train.py index c6a2d4e7c973fc98c1c077f5801f8ecfc16dcb02..201860baffa12bc9c572aca5aa0501b03ecad6a6 100644 --- a/eda/esmm/Model_pipline/train.py +++ b/eda/esmm/Model_pipline/train.py @@ -362,6 +362,13 @@ def main(_): elif FLAGS.task_type == 'export': print("Not Implemented, Do It Yourself!") + tl = timeline.Timeline(run_metadata.step_stats) + ctf = tl.generate_chrome_trace_format() + with open(FLAGS.local_dir +'timeline.json', 'w') as wd: + wd.write(ctf) + print("耗时(分钟):") + print((time.time()-b)/60) + if __name__ == "__main__": b = time.time() @@ -370,9 +377,3 @@ if __name__ == "__main__": run_metadata = tf.RunMetadata() tf.logging.set_verbosity(tf.logging.INFO) tf.app.run(options=ptions, run_metadata=run_metadata) - tl = timeline.Timeline(run_metadata.step_stats) - ctf = tl.generate_chrome_trace_format() - with open(FLAGS.local_dir +'timeline.json', 'w') as wd: - wd.write(ctf) - print("耗时(分钟):") - print((time.time()-b)/60) \ No newline at end of file