Welcome to RDK X5 Board repository
10.Model training conversion
Model Training and Conversion
After completing the dataset annotation tutorial content, we can use the main board to start training the model.
This tutorial only introduces CLI model training and conversion. You can refer to the official website for Python case modifications.Due to performance reasons, model training on Raspberry Pi 5 main board takes a long time, please wait patiently.
1. Model Training
Use CLI commands to directly train the model: copy the yolo26n.pt file to the directory where the configuration file is located, then open a terminal in the configuration file directory:
xxxxxxxxxxcd /home/pi/ultralytics26/data/yahboom_data/orange_data
xxxxxxxxxxyolo detect train data=orange.yaml model=yolo26n.pt epochs=100 imgsz=640
data: Dataset configuration file
model: Pre-trained model file
epochs: Number of training epochs
imgsz: Input specified image size

2. Model Conversion
The final model will be generated in the runs folder: generally select the best.pt file for use
xxxxxxxxxx/home/sunrise/ultralytics26/data/yahboom_data/orange_data/runs/detect/train/weights
Convert pt model to ncnn model:
xxxxxxxxxxcd /home/sunrise/ultralytics26/data/yahboom_data/orange_data/runs/detect/train/weights
xxxxxxxxxxyolo export model=best.pt format=ncnn
References
Model Training with Ultralytics YOLO - Ultralytics YOLO Documentation