当前位置:   article > 正文

YOLO v8的用于训练数据集的训练配置命令与训练函数_yolov8进行训练的终端命令

yolov8进行训练的终端命令

YOLO v8的代码地址为:https://github.com/ultralytics/ultralytics

YOLO v8的配置(训练,验证,测试)文件放在:ultralytics/cfg/default.yaml中

一般有两种训练数据集的方式:

第一种:在终端输入训练命令:

训练

yolo task=detect mode=train model=yolov8n.pt data=datasets/cooc128.yaml batch=16 epochs=100 imgsz=640 workers=8 

验证

yolo task=detect mode=val model=runs/detect/train/weights/best.pt data=datasets/coco128.yaml

导出

yolo task=detect mode=export model=runs/detect/train/weights/best.pt

第二种:创建train.py文件,添加以下代码,运行train.py

  1. from ultralytics import YOLO
  2. # Load a model
  3. model = YOLO('yolov8.yaml') # build a new model from YAML
  4. model = YOLO('yolov8n.pt') # load a pretrained model (recommended for training)
  5. model = YOLO('yolov8.yaml').load('yolov8n.pt') # build from YAML and transfer weights
  6. # Train the model
  7. model.train(data='coco128.yaml', epochs=100, imgsz=640,workers=8 )

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/162310
推荐阅读
相关标签
  

闽ICP备14008679号