Files
琉璃月光 67883f1a50 最新推送
2026-03-10 14:14:14 +08:00

22 lines
717 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding:utf-8
from ultralytics import YOLO
# 模型配置文件,此处以 s 为例,只需要写 yolo11s.yaml yolo11.yaml 会自动定位为 yolo11s 模型
# 如果写成yolo11m.yaml yolo11.yaml 会自动定位为 yolo11m 模型
model_yaml_path = r"ultralytics/cfg/models/11/MobileNetV4.yaml"
# 数据集配置文件
data_yaml_path = r'/home/hx/yolo11-jz/ailaidata.yaml'
# 预训练模型
pre_model_name = 'yolo11n.pt'
if __name__ == '__main__':
# 加载预训练模型
model = YOLO(model_yaml_path, task='detect').load(pre_model_name)
# 训练模型
results = model.train(
data=data_yaml_path,
epochs=100,
batch=16,
name='train_emoKDEF_MobileNetV4_s',
)