Open K4HVH opened 7 months ago
I am not a expert in this.But i would like to share some insights. I earlier worked on yolov9 with custom dataset and had this same error. Try reducing the batch size to 8 or 12 and use gpu. It worked for me but i dont how it works like that
Hope this helps!
Any update on your situation @K4HVH ? Because i get the same error and i can't figure it out
Hi there, not an expert here but maybe this helps:
Yolov9 (normal model) uses auxiliary branches for the training to achieve better mAP. In inference these branches have to be "removed" resulting in same mAP but faster inference. Removing these auxiliary branches is done by reparameterizing, resulting the converted
weights like yolov9-c-converted.pt
you are trying to use. These auxiliary branches are also the reason you have to use train_dual.py
for yolov9-c.pt
weights.
So the quick answer is:
yolov9-converted.pt
weights with train_dual.py
as it requires weights for the auxiliary branches. (Idk if you can use the converted weights with train.py
. You have to try that but #175 (comment) says you'll need to use gelan-c.yaml
)python train_dual.py --weights yolov9-c.pt
and don't forget to reparameterize for inference later.More details see #209 (comment) and #131
I decided to switch to yolov10, it works well now
Issue:
When starting training, YoloV9 will crash during the first epoch. There is no error message, it will simply quit out.
Setup/Environment
Other Details
Configs:
Command Used:
python train_dual.py --batch 16 --img 640 --epochs 50 --min-items 0 --close-mosaic 15 --data data.yaml --weights yolov9-c-converted.pt --device 0 --cfg yolov9-c.yaml --hyp data/hyps/hyp.scratch-high.yaml
Data.yaml:
Yolov9-c.yaml: