pt -> engine
ONNONS opened this issue · 1 comments
ONNONS commented
How can I convert a pt file into an engine?
noahmr commented
Hi ONNONS,
Thank you for creating this issue, I realize now that there aren't really any good instructions for this on the project page.
The process of exporting a .pt file is described in the official YOLOv5 repository here. You can first export from pt to ONNX through their export script:
python3 export.py --weights YOUR_PT_MODEL.pt
and then build the TensorRT engine using the tools from this project:
build_engine --model YOUR_ONNX_MODEL.onnx --output yolo.engine
Since a short while the export.py script can also export to TensorRT directly, but internally its doing exactly the same, and I haven't tested it myself.