安裝
anaconda3
conda create -n yolov8 python=3.8
## 進入yolov8 虛擬環境
activate yolov8
pip install ultralytics
conda install chardet
安裝pytorch、cuda
https://pytorch.org/get-started/locally/
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
安裝onnx格式支援
conda install onnx
匯出pt模型為onnx格式:
yolo export model=best.pt format=onnx
https://docs.ultralytics.com/tasks/detect/#models
訓練:
yolo detect train data=my_coco.yaml model=yolov8s.pt epochs=150 imgsz=640 batch=64 workers=0 device=0