Skip to content

Latest commit

 

History

History
45 lines (36 loc) · 1.18 KB

yolov8-export.md

File metadata and controls

45 lines (36 loc) · 1.18 KB

YOLOv8 Export Instructions

Install YOLOv8 following Ultralytics official documentation and export the model in different formats using the following commands:

Torchscript

yolo export model=best.pt format=torchscript

Note: best.pt corresponds to your trained YOLOv8n/s/m/x model.

OnnxRuntime

yolo export model=best.pt format=onnx

OpenVINO

yolo export model=best.pt format=openvino

TensorFlow

yolo export model=best.pt format=saved_model

After running, check that SignatureDefs serving_default is not empty:

saved_model_cli show --dir <your_yolov8_saved_model> --all

TensorRT

yolo export model=best.pt format=engine

Alternatively, use trtexec:

trtexec --onnx=best.onnx --saveEngine=best.engine

Export with dynamic axis example:

trtexec --onnx=yourmodel.onnx --minShapes=images:1x3x640x640 --optShapes=images:1x3x640x640 --maxShapes=images:32x3x640x640 --saveEngine=yourmodel.engine --fp16

Note: When using TensorRT, ensure that the version installed under Ultralytics python environment matches the C++ version you plan to use for inference.