创建虚拟环境
conda activate yolov9 -n python=3.8
conda acitivate yolov9
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
数据准备
在主文件夹创建一个data.yaml文件
data(images\labels)
splitdata.py(train\test\val)
训练
models/segment/gelan-c-seg.yaml这个文件里面修改nc值为1
python segment/train.py --workers 8 --device 0 --batch 32 --data data.yaml --img 640 --cfg models/segment/gelan-c-seg.yaml --weights 'gelan-c-seg.pt' --name gelan-c-seg --hyp hyp.scratch-high.yaml --no-overlap --epochs 100 --close-mosaic 10
标签:pt,--,yolov9,seg,yaml,gelan,data
From: https://blog.csdn.net/weixin_48679164/article/details/141666982