1

How to measure the time of execution of running a given task in the session?

sess.run(variables)
cerebrou
  • 5,353
  • 15
  • 48
  • 80
  • Possible duplicate of [Can I measure the execution time of individual operations with TensorFlow?](https://stackoverflow.com/questions/34293714/can-i-measure-the-execution-time-of-individual-operations-with-tensorflow) – benjaminplanche Apr 05 '18 at 08:44

1 Answers1

6

You can use the python time package, as Tensorflow authors did in the AlexNet Benchmark

start_time = time.time()
_ = session.run(variables)
duration = time.time() - start_time
print(duration)
nessuno
  • 26,493
  • 5
  • 83
  • 74