1.数据和网络模型
数据:[1, 3, 256, 256].
模型:resnet18
模型大小:pth89.5M 转换成onnx模型,压缩到44.7M,压缩了一半多。
2.cuda加速pth模型
用时(s)平均用时7ms
0.008384227752685547
0.008441686630249023
0.006928443908691406
0.007239341735839844
0.006813764572143555
0.006902456283569336
0.006703853607177734
0.00638580322265625
0.0069429874420166016
0.006941080093383789
0.006896257400512695
0.0064046382904052734
0.0062482357025146484
0.0062847137451171875
0.006282806396484375
0.006196498870849609
0.006886482238769531
0.007439613342285156
3.不加速onnx模型(onnxruntime cpu版)
用时(s)平均用时5ms
0.005276203155517578
0.005966663360595703
0.0051767826080322266
0.00515437126159668
0.005184173583984375
0.005034923553466797
0.005269765853881836
0.005064725875854492
0.005131959915161133
0.0049817562103271484
0.00508427619934082
0.004971742630004883
0.0050334930