deep-diver / Soccer-Ball-Detection-YOLOv2

YOLOv2 trained against custom dataset
116 stars 43 forks source link

boxes not accurate #12

Closed skywo1f closed 4 years ago

skywo1f commented 5 years ago

The neural network on Darkflow is not training correctly.

At first I thought I did not have enough images, or maybe a bad starting network. So I tried this example.

I can test with a pretrained network just fine. It is only when I try to train on a network that I get nonsense. Yet at the end of 100 epochs I have:

step 1100 - loss 1.004814863204956 - moving ave loss 1.1848642304486146 Finish 100 epoch(es)

I am training with:

flow --model cfg/yolo_custom.cfg --load bin/yolo.weights --train --annotation labelImg/annotations --dataset labelImg/images --epoch 100 --gpu 1.0

and testing with:

flow --model cfg/yolo_custom.cfg --load bin/yolo.weights --demo test_video.mp4 --saveVideo

I am seeing:

https://imgur.com/a/wcdeDuY

skywo1f commented 5 years ago

Figured it out. there were 2 things.

  1. I needed to tell it to load a particular checkpoint of that configuration with "--load 21000" (or whatever number was most recent)
  2. I needed to overfit it on 3-5 images first, then let it train on the rest of the images.