Welcome to DOFBOT-Ultra repository
10. Model Training and Conversion
Model Training and Conversion
Please ensure that the web control program backend process is not running in the background. To close it, refer to the [Get Started Quickly - 2. Access the Terminal] section in [Disable the Auto-Start Web Control Backend Process]. After closing, please restart DofbotUltra!!!
After completing the dataset annotation tutorial, we can start training the model on the board.
This tutorial only covers CLI model training and conversion. You can refer to the official website for Python case modifications.Due to performance limitations of the Raspberry Pi 5 board, model training takes a long time. Please be patient.
1. Model Training
Use CLI commands to directly train the model: Copy the yolo26n.pt file to the configuration file directory, then open a terminal in that directory.
xxxxxxxxxxcd /home/pi/ultralytics/ultralytics/data/yahboom_data/orange_data
xxxxxxxxxxyolo detect train data=orange.yaml model=yolo26n.pt epochs=100 imgsz=640 batch=2 workers=0 amp=False device=cpu
data: Dataset configuration file
model: Pre-trained model file
epochs: Number of training epochs
imgsz: Input image size


2. Model Conversion
The final model will be generated in the runs folder. Generally, the best.pt file is used.
xxxxxxxxxx/home/pi/ultralytics/ultralytics/data/yahboom_data/orange_data/runs/detect/train/weights
Convert the pt model to onnx or ncnn model:
xxxxxxxxxxcd /home/pi/ultralytics/ultralytics/data/yahboom_data/orange_data/runs/detect/train/weights
xxxxxxxxxxyolo export model=best.pt format=onnxyolo export model=best.pt format=ncnn


