我有两个TF模型,我想比较它们预测的速度。我知道TF模型有evaluate方法,每步推理输出ms。但是,有没有比这更高的精度?如果有,正确的方法是什么?
evaluate
rsaldnfx1#
试试这个:
import time start_time=time.time() model.predict( etc....... end_time=time.time() duration= end_time-start_time hours = tr_duration // 3600 minutes = (tr_duration - (hours * 3600)) // 60 seconds = tr_duration - ((hours * 3600) + (minutes * 60)) msg = f'training elapsed time was {str(hours)} hours, {minutes:4.1f} minutes, {seconds:4.2f} seconds)_ print (msg) # print out training duration time
1条答案
按热度按时间rsaldnfx1#
试试这个: