WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.02k stars 4.12k forks source link

Instance segmentation (yolov7-seg.yaml) worse performance with --image 1280 then 800 #1348

Open Robotatron opened 1 year ago

Robotatron commented 1 year ago

Below two runs with identical hyper parameters and everything else, except image size. Red graph = image size 1280, blue graph = 800.

Launch parameters used: python seg/segment/train.py --img 1280 --epochs 300 --data dataset.yaml --weights '' --cfg yolov7-seg.yaml --hyp hyp.scratch-high.yaml --batch 12 --name del

Usually a bigger image size should provide better mAP score, but not here, I wonder why? Could it be because the model architectures only goes till P5? In YOLO5 for image size 1280 they use a model with additional P6 and P7 layers to train with image size of 1280.

Any ideas of why img size of 1280 performs worse then 800 and maybe any advice on what to do here?

image

Alberto1404 commented 1 year ago

@Robotatron not only the image size has changed. In both cases, you are training from random initial weights, which can derive in a better / worse performance depending on achieving a minimun during gradient descent. Try to initialize both cases with the same weights (i.e. pretrained ones) and check again if this occurs.

vtyw commented 1 year ago

@Robotatron Larger is not always better, the scale of objects changes (for better or worse).