YOLO-yaml/pt模型文件的差异

YOLO yaml与pt模型的区别

核心区别一句话总结

  • YOLO('yolov8n.yaml')从头开始创建一个全新的、未训练(随机初始化权重)的模型。它的架构由这个 YAML 文件定义。

  • YOLO('yolov8n.pt')加载一个已经预训练好的模型。这个 .pt 文件包含了模型的架构定义训练好的权重

下面我们进行详细的对比分析。


1. YOLO('yolov8n.yaml')

文件性质
  • 文本配置文件:这是一个用 YAML 格式编写的纯文本文件。

  • 模型架构定义:它详细描述了模型的结构,包括:

    • 模型的深度(层数)、宽度(通道数)。

    • 每一层的类型(如 ConvBottleneckSPPFDetect 等)。

    • 每一层的参数(如 kernel_sizefilters)。

    • 层与层之间的连接方式。

作用与用途
  • 初始化新模型:当你执行 YOLO('yolov8n.yaml') 时,Ultralytic

WARNING ⚠️ no model scale passed. Assuming scale='n'. New https://pypi.org/project/ultralytics/8.3.144 available 😃 Update with 'pip install -U ultralytics' Ultralytics 8.3.18 🚀 Python-3.11.11 torch-2.7.0+cu126 CUDA:0 (NVIDIA GeForce RTX 4090, 24111MiB) engine/trainer: task=detect, mode=train, model=ultralytics/cfg/models/11/yolo11-DCNv2.yaml, data=data/NEU-DET.yaml, epochs=100, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=0, workers=0, project=runs/train, name=exp, exist_ok=False, pretrained=True, optimizer=SGD, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=True, opset=None, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, copy_paste_mode=flip, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/train/exp Traceback (most recent call last): File "/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/ultralytics/engine/trainer.py", line 557, in get_dataset data = check_det_dataset(self.args.data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/ultralytics/data/utils.py", line 329, in check_det_dataset raise FileNotFoundError(m) FileNotFoundError: Dataset 'data/NEU-DET.yaml' images not found ⚠️, missing path '/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/datasets/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/data/NEU-DET/val.txt' Note dataset download directory is '/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/datasets'. You can update this in '/root/.config/Ultralytics/settings.json' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/train.py", line 8, in <module> model.train(data='data/NEU-DET.yaml', File "/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/ultralytics/engine/model.py", line 796, in train self.trainer = (trainer or self._smart_load("trainer"))(overrides=args, _callbacks=self.callbacks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/ultralytics/engine/trainer.py", line 133, in __init__ self.trainset, self.testset = self.get_dataset() ^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/ultralytics/engine/trainer.py", line 561, in get_dataset raise RuntimeError(emojis(f"Dataset '{clean_url(self.args.data)}' error ❌ {e}")) from e RuntimeError: Dataset 'data/NEU-DET.yaml' error ❌ Dataset 'data/NEU-DET.yaml' images not found ⚠️, missing path '/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/datasets/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/data/NEU-DET/val.txt' Note dataset download directory is '/root/autodl-tmp/ultralytics-yolo11/ultralytics-yolo11/datasets'. You can update this in '/root/.config/Ultralytics/settings.json'
05-26
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值