赞
踩
可以多多关注我吗???
1、官网下载代码与权重.(权重放在根目录下)
2、conda create -n yolov9 python=3.8
后激活 activate yolov9
3、使用该虚拟环境并点击“与该虚拟环境绑定”
4、虚拟环境中,pip install -r requirements.txt,安装库
5、卸载依赖中torch的CPU环境,pip uninstall torch
安装pytorch官网的pytorch命令,以下为11.8版本(注意版本不可小于cuda),下载时间比较长,别用清华源。
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia,到此GPU环境搭建结束。一切均结束。
6、增加这个test.py,验证GPU环境。直接运行,看是否为GPU环境。
7、将权重文件路径和配置文件路径依次填入train脚本中,如下:
8、创建一个数据集配置文件并修改AI-DOT.yaml中的数据集路径,如下:(以AI-DOT数据集为例)
9、复制刚才创建的yaml文件的路径,粘贴到train脚本的data参数中。并将hyp参数的值改为data/hyps/hyp.scratch-high.yaml
10、2024.2.22日官网发布的代码存在bug,将utils工程下loss_tal脚本中的第167行中的p改为p[0]或p[1],改完能运行。
11、运行train.py
v9运行中,出现attributeerror: ‘FreeTypeFont‘ object has no attribute ‘getsize‘,因为安装了新版本的 Pillow 删除了getsize 功能
,降级到 Pillow 9.5 ,即可。
运行pip install Pillow==9.5
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。