【问题标题】:How to measure the time of sess.run() from TensorFlow?如何从 TensorFlow 测量 sess.run() 的时间?
【发布时间】:2017-02-28 18:07:49
【问题描述】:

如何测量会话中运行给定任务的执行时间?

sess.run(variables)

【问题讨论】:

标签: tensorflow


【解决方案1】:

您可以使用 python time 包,就像 Tensorflow 作者在 AlexNet Benchmark 中所做的那样

start_time = time.time()
_ = session.run(variables)
duration = time.time() - start_time
print(duration)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-27
    • 1970-01-01
    • 1970-01-01
    • 2017-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-07
    相关资源
    最近更新 更多