- The process is the same for YOLOv8 and other models managed by Ultralytics in their library.
Install YOLO11 following Ultralytics official documentation and export the model in different formats using the following commands:
yolo export model=best.pt format=torchscriptNote: best.pt corresponds to your trained YOLO11n/s/m/x model.
yolo export model=best.pt format=onnxyolo export model=best.pt format=openvinoyolo export model=best.pt format=saved_modelAfter running, check that SignatureDefs serving_default is not empty:
saved_model_cli show --dir <your_yolo11_saved_model> --allyolo export model=best.pt format=engineAlternatively, use trtexec:
trtexec --onnx=best.onnx --saveEngine=best.engineExport with dynamic axis example:
trtexec --onnx=yourmodel.onnx --minShapes=images:1x3x640x640 --optShapes=images:1x3x640x640 --maxShapes=images:32x3x640x640 --saveEngine=yourmodel.engine --fp16Note: When using TensorRT, ensure that the version installed under Ultralytics python environment matches the C++ version you plan to use for inference.