How to train YOLOv9 Instance Segmentation on a Custom Dataset

feature-request
Hello, in the official YOLOv9 repository, the code for training YOLOv9 instance segmentation was updated several hours ago as mentioned in the following links: Is YOLO v9 segmentation task open-sourced? · Issue #174 · WongKinYiu/yolov9 · GitHub
I am a newbie and quite confused about how to export YOLOv9 Instance Segmentation Dataset format from roboflow.
I did a try on YOLOv9 Instance Segmentation on my Roboflow dataset several hours ago but failed, and here is what I did:

  1. I downloaded the latest official YOLOv9 GitHub repository manually instead of downloading it by
git clone https://github.com/SkalskiP/yolov9.git

as the latest repository has not been released yet.

  1. Export YOLOv9 format from my Roboflow dataset version. I have used this dataset format for YOLOv9 Object Detection and it works fine. Now I want to use the same dataset format for YOLOv9 Instance Segmentation. In Roboflow platform, my dataset is well-annotated by polygon masks.

  2. train:

python segment/train.py --epochs 50 --batch 1 --img 1408 --workers 8 --device 0 \
--data /mydatasetroot/data.yaml \
--cfg models/segment/gelan-c-seg.yaml \
--weights /myweightsroot/gelan-c-seg.pt \
--name gelan-c-seg --hyp hyp.scratch-high.yaml --no-overlap --close-mosaic 10

where I used this code for training: WongKinYiu/yolov9/blob/main/segment/train.py
as the training process continued, I found something went wrong. The P, R, and mAP50 values all became 0 after epoch 3:


I searched for the issues in YOLOv9 repository and found this similar issue: During training, these parameters are all 0 --- P, R, mAP50 · Issue #252 · WongKinYiu/yolov9 · GitHub
and the author said referring to his warning messages, it may be because his labels are not in the correct format. But I have not got any warning messages on my labels’ format, so I think my situation is not quite the same as his.

It would be constructive if anyone could provide a demo jupyter notebook on how to train YOLOv9 Instance Segmentation on a custom dataset exported from Roboflow platform.
I appreciate your patience in reading these.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.