Sleeping-post-detection-fir.../ceshi.py

18 lines
534 B
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#测试训练集
from ultralytics import YOLO
# 创建 YOLOv8 模型实例,选择适合的配置文件
model = YOLO('yolov8n.yaml') # YOLOv8 Nano 配置文件(这个是从官网上下载的预训练模型)
# 配置训练参数
model.train(
data='data.yaml', # 数据配置文件
epochs=150, # 训练轮数
batch=8, # 批量大小(适合 CPU 计算)
imgsz=320, # 图像尺寸(较小尺寸适合 CPU
device='cpu' # 训练设备设置为 CPU本人用的是cpu
)