With TensorRT 10.3(R36.4.3), the inference results of both FP32 and FP16 are close to ONNX Runtime. However, after using TensorRT 10.13(R38.4.0), only FP32 inference remains consistent with ONNX Runtime, while FP16 shows significant discrepancies.
Reproduction steps:
python3 export_onnx.py
python3 run.py
export_onnx.py generates yolov10n.onnx, which can be used for the following tests.
run.py generates three output images: ort_result.png, trt_result.png, and trt_fp32_result.png.
Note: export_onnx.py was tested with Ultralytics 8.4.98 and PyTorch 2.8.0+cu126.
file.zip
With TensorRT 10.3(R36.4.3), the inference results of both FP32 and FP16 are close to ONNX Runtime. However, after using TensorRT 10.13(R38.4.0), only FP32 inference remains consistent with ONNX Runtime, while FP16 shows significant discrepancies.
Reproduction steps:
python3 export_onnx.py
python3 run.py
export_onnx.py generates yolov10n.onnx, which can be used for the following tests.
run.py generates three output images: ort_result.png, trt_result.png, and trt_fp32_result.png.
Note: export_onnx.py was tested with Ultralytics 8.4.98 and PyTorch 2.8.0+cu126.
file.zip