openvino在不同batchsize下的性能对比

之前写过一篇关于tensorrt的:tensorrt在不同batchsize下的性能对比

模型还是使用的这篇文章的模型,只是将其转换成了openvino模型了,然后使用benchmark进去测试

benchmark要想使用需要自己进行编译:https://blog.csdn.net/zhou_438/article/details/112974101

然后就可以进行测试了

举个具体的例子,下面的命令是batchsize=32:

benchmark_app.exe -m  ctdet_coco_dlav0_512.xml -d CPU -i 2109.png  -b 32

其余的batchsize需要自己进行测试然后汇总数据进行观察

然后将数据进行可视化,结果如下:

import numpy as  np
import pandas as pd
import matplotlib.pyplot as plt
plt.tight_layout()

df1=pd.read_csv("FirstInference.txt",sep=' ')
df2=pd.read_csv("Latency.txt",sep=' ')
df=pd.merge(df1,df2,how = 'inner',on='batchsize')
print(df.head())
x =df['batchsize'].values
y1 =df['FirstInference'].values
y2 =df['Latency'].values
plt.plot(x, y1, 'ro--',label='FirstInference')
plt.plot(x, y2, 'bo-',label='Latency')
plt.xlabel('batchsize')
plt.ylabel('time(ms)')

plt.legend()
plt.show()

 

 可以看出cpu不管你batchsize设置多大,推理的时间实际上也是线性增加

吞吐量几乎没有变化,图上看起来波动较大,实际上数据在一个小范围下变化

猜你喜欢

转载自blog.csdn.net/zhou_438/article/details/113108817
今日推荐