如何在Tensorflow CNN中找到/计算单个图像的推断时间?
发布于 2022-06-13 18:09:08
见下面的代码
import time
start_time= time.time() # set the time at which inference started
model.predict (etc
stop_time=time.time()
duration =stop_time - start_time
hours = duration // 3600
minutes = (duration - (hours * 3600)) // 60
seconds = duration - ((hours * 3600) + (minutes * 60))
msg = f'training elapsed time was {str(hours)} hours, {minutes:4.1f} minutes,
{seconds:4.2f} seconds)'
print (msg, flush=True) # print out inferenceduration timehttps://stackoverflow.com/questions/72606735
复制相似问题