训练数据集操作方法总结

参考博客

  1. 移动九天毕昇https://blog.csdn.net/weixin_45887062/article/details/126796359

  1. 肆十二:(B站有详细解说)https://blog.csdn.net/ECHOSON/article/details/121939535?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167575042916800180614602%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=167575042916800180614602&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-1-121939535-null-null.142^v73^insert_down1,201^v4^add_ask,239^v1^insert_chatgpt&utm_term=%E8%82%86%E5%8D%81%E4%BA%8C&spm=1018.2226.3001.4187

  1. yolov5原理与源码学习(detect.py和train.py)https://blog.csdn.net/qq_60257376/article/details/122281836

  1. 关于迭代次数https://www.bilibili.com/read/cv14331065

  1. 肆十二详细参数介绍https://blog.csdn.net/weixin_45662399/article/details/125158953

  1. Computer Vision Datasetshttps://blog.csdn.net/wchwdog13/article/details/128311482

配置过程

  1. 上传数据,将数据集文件和代码文件上传在平台上

  1. 在等待的时间里可以进行查看conda源镜像配置

  1. conda config --show

  1. 解压zip unzip yolo_master(名称)

  1. 在代码目录里面进行创建conda环境

  1. conda create -n 名称 python=3.8(注意windos下要用==)

  1. conda activate 名称

  1. 查看显卡信息 nvidia-smi

  1. 根据显卡安装对应torch

技巧快速:先安装官网有的版本会比较快,后面之后更改后面数字到对应显卡版本之后会比较快

  1. 检查pytorch安装成功

python
import torch
print(torch.cuda.is_available())
正确结果为:True
  1. pycocotools的安装(linux系统后面不用加-windows)

pip install pycocotools-windows

最后安装需要的文件

pip install -r requirements.txt

最后训练

python train.py --data mask_data.yaml --cfg mask_yolov5s.yaml --weights pretrained/yolov5s.pt --epoch 100 --batch-size 4 --device cpu

注意data/mask_data.yaml和models/mask_yolov5s.yaml的参数以及路径修改

epoch是迭代次数

batch-size是每次照片的数量

每次batchsize超过4就报错,可能是与显卡个数有关

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值