NVIDIA / TensorRT

NVIDIA® TensorRT™ is an SDK for high-performance deep learning inference on NVIDIA GPUs. This repository contains the open source components of TensorRT.
https://developer.nvidia.com/tensorrt
Apache License 2.0
10.48k stars 2.1k forks source link

export yolo model problem #4009

Closed fuzhu325 closed 1 month ago

fuzhu325 commented 1 month ago

i exported yolo model with this api code:YOLO("best.pt",task="detect").export(format="engine",imgsz=160)

and i sure the input image is 1601603 but exported tensorrt model excepted oringinal size with 6406403 why?

[07/13/2024-11:28:37] [TRT] [E] IExecutionContext::setInputShape: Error Code 3: API Usage Error (Parameter check failed, condition: engineDims.d[i] == dims.d[i]. Static dimension mismatch while setting input shape for images. Set dimensions are [1,3,640,640]. Expected dimensions are [1,3,160,160].)

fuzhu325 commented 1 month ago

solved by set the predict parameter "imgsz" to 160