yasenh / libtorch-yolov5

A LibTorch inference implementation of the yolov5
MIT License
372 stars 114 forks source link

engine #67

Closed yuanhs1996 closed 1 month ago

yuanhs1996 commented 1 month ago

Hello, I would like to ask how to convert weights from torchscript format to engine format. After the conversion, do I need to modify the program in order to run it?

yasenh commented 1 month ago

Hi @yuanhs1996, my understanding is that you want to inference in TensorRT? If so I would recommend exporting the onnx directly from the pt format, and build engine with TensorRT APIs, either python/C++ API would work. Here is an example: https://github.com/cyrusbehr/tensorrt-cpp-api?tab=readme-ov-file#sanity-check

Let me know if any questions :)

yuanhs1996 commented 1 month ago

Thank you for your answer, it was very helpful.