dynamic|static X fp16|fp32 Tensrort Engine Inference Using Yolov5 Model
experiment condition: python==3.8.0 torch==2.1.0 ultralytics:77fc5ccf02ac0fdf9e7bb1eeb003e9bf3e719702 tensorrt==8.6.1.post1 dynamic static fp16 dynamic_fp16 static_fp16 fp32 static_fp32 另外训练时候的padding模式决定了模型inference时候的前处理形式,进而导致不同的运行时间,在letterbox函数进行 前处理的时候,以下代码都保证了模型的正确输出,但并不能保证此种调用方式是效率最佳的方式,还需要继续优化。 Dynamic_Fp16 inshape from get_binding_shape(0): (1, 3, -1, 640) outshape from get_binding_shape(1): (0) dynamic inshape: (1, 3, 640, 640) dynamicoutshape: (1, 7, 8400) trt_run.py:71: DeprecationWarning: Use set_input_shape instead. context.set_binding_shape(0, image.shape) trt_run.py:72: DeprecationWarning: Use set_input_shape instead. context.set_binding_shape(1, output.shape) [11/23/2023-23:19:05] [TRT] [E] 3: [executionContext.cpp::setBindingDimensions::1511] Error Code 3: API Usage Error (Parameter check failed at: runtime/api/executionContext.cpp::setBindingDimensions::1511, condition: mEngine.bindingIsInput(bindingIndex) ) set binding time: 0....