AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.68k stars 7.96k forks source link

Train Tiny Yolo V2 with COCO #569

Open LouiseAbela opened 6 years ago

LouiseAbela commented 6 years ago

Hi,

I tried a lot of things and can't find out how to do it. When training with COCO but only 7 classes using yolov2-tiny as config and weights, and change the classes to 7 and filters to 60, the error stays around 2 and doesn't go down. Does anyone have a clue why please?

Thanks very much!

LouiseAbela commented 6 years ago

Just to get an idea the chart looks like this after almost 60000 epochs. Thanks again :)

chart

AlexeyAB commented 6 years ago

Hi,

LouiseAbela commented 6 years ago

And thanks for answering :).

AlexeyAB commented 6 years ago
  1. Check, do you use in yolov2-tiny.cfg?

    batch=64
    subdivisions=2

    And removed any other lines with batch and subdivision?

  2. Do you try to train for the first 7 classes?

    person
    bicycle
    car
    motorbike
    aeroplane
    bus
    train
  3. If all are correct, the try to use in cfg-file

    learning_rate=0.001
    max_batches = 120000
    policy=steps
    steps=-1,100,80000,100000
    scales=.1,10,.1,.1
LouiseAbela commented 6 years ago

Hi,

  1. Yes I am using that configuration and have those values for the batches, and have the testing ones commented.

  2. Not the first 7 but I did of course create the new labels with the new indexes, and double checked with the old that the annotations are correct.

    
    person
    bicycle
    car
    motorbike
    bus
    cat
    dog
  3. I will try that today and get back to you :)

Thanks again !

RushNuts commented 6 years ago

Hi @LouiseAbela

  1. which model you use for training tiny with COCO dataset
  2. what are the results of the training now?
LouiseAbela commented 6 years ago

@AlexeyAB I will let you know sorry didn't had the time to get to it, just started the training now.

@RushNuts

  1. I'm using the Yolov2-tiny.cfg (of course modified for just 7 classes) - I attached my config file here
  2. Running it now as didn't had time to get to it during this week, will let you know when it finished
[net]
batch=64
subdivisions=8
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
max_batches = 120000
policy=steps
steps=-1,100,80000,100000
scales=.1,10,.1,.1

[convolutional]
batch_normalize=1
filters=16
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=1

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

###########

[convolutional]
batch_normalize=1
size=3
stride=1
pad=1
filters=512
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=60
activation=linear

[region]
anchors =  0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828
bias_match=1
classes=7
coords=4
num=5
softmax=1
jitter=.2
rescore=0

object_scale=5
noobject_scale=1
class_scale=1
coord_scale=1

absolute=1
thresh = .6
random=1
RushNuts commented 6 years ago

@LouiseAbela okay, thanks for your answer. I'll wait you. One more thing, which pre-trained model you use? darknet19_448?

LouiseAbela commented 6 years ago

@AlexeyAB @RushNuts, still the maP stays really low 👎. I don't know what to change more with it.

No no I used - yolov2-tiny.weights and then convert them to .conv.13, but I also trained it without weights it doesn't help. I try to debug it a little and see what is happening, maybe it's just a stupid mistake.

RushNuts commented 6 years ago

@LouiseAbela I have a similar problem. AVG does not go below 1.5, of this the percentage of detection is very low and many false positives. My .cfg file is the same as yours, also used .conv.13 after conversion...uh

barry41409 commented 5 years ago

Hi ,@LouiseAbela , @RushNuts Do you have any idea training tiny yolov2? I use .conv.13 weight and VOC dataset, but the mAP is lower than website.