Darknet: train tiny-yolo..again..

Created on 28 Mar 2018  ·  20Comments  ·  Source: pjreddie/darknet

Most helpful comment

Then take this weightfile and use ./darknet partial tiny-yolo-voc.cfg tiny-yolo-voc.weights tiny-yolo-voc.conv.13 13 and adapt it to your cfg.
The number 13 tells how many layer you want, you want e.g. just before the final layer which does the detection.

If the command doesn't exist in pjreddies repo then you can use alexeyab's repo instead. In Alexey's repo you are also able to train without any initialized weights, by issuing the train command without any weights (then it will initialize with random weights).

All 20 comments

I guess tiny-yolo.cfg is leftover from earlier commit (you probably did some changes). It got renamed to yolov2-tiny.cfg. There are no changes in the two version just rename as you can see here tiny-yolo.cfg compared to yolov2-tiny.cfg the different configs are probably due to your own modifications.

Pre-trained model available at https://pjreddie.com/darknet/yolo/ in the table

Then take this weightfile and use ./darknet partial tiny-yolo-voc.cfg tiny-yolo-voc.weights tiny-yolo-voc.conv.13 13 and adapt it to your cfg.
The number 13 tells how many layer you want, you want e.g. just before the final layer which does the detection.

If the command doesn't exist in pjreddies repo then you can use alexeyab's repo instead. In Alexey's repo you are also able to train without any initialized weights, by issuing the train command without any weights (then it will initialize with random weights).

@RushNuts the syntax is the same for coco it is just an example.

yolov2 is the same in both repositories, the cfg isn't changed it either. You can get the weights from https://pjreddie.com/darknet/yolo/ or use the old site dedicated for yolov2 https://pjreddie.com/darknet/yolov2/

@TheMikeyR how can I train my tiny YOLO for some objects from COCO dataset?

@MizbaMohammed https://pjreddie.com/darknet/yolov2/ follow the section "Training YOLO on COCO" adapt the files to the classes you want to train from coco, and update the lines to use tiny-yolo. You should also follow "Download Pretrained Convolutional Weights" and download the tiny-yolo weights and extract the 13 first layers.

@TheMikeyR Hey Mike, I want to train the tiny YOLO which was trained on VOC dataset to train for few objects in COCO. what all changes do I have to make in that case? Do I have to combine all the data and train tiny Yolo again?

You need to change the filtersize in the config to present the amount of classes you want to train, info on this in the website or multiple issue threads.

Then you need to scrap the coco dataset and take out the classes you want and tell yolo to train on it.

can anybody explain this
@pjreddie
@TheMikeyR
[convolutional]
size=1
stride=1
pad=1
filters=425
activation=linear

why batch_norm is not added and why activation is linear?

@TheMikeyR Where can I download tiny-yolo-voc.conv.13?

@TheMikeyR
man i have a doubt can i label both dog and cat for annotation in only one txt file while training in below image
fotolia_8527249_xs

second doubt
how yolo learning the patter while training?

@abdulkalam1233 yes and then you need to put a bounding box with the two classes around cat and dog.

Check out the papers
https://pjreddie.com/media/files/papers/yolo_1.pdf
https://pjreddie.com/media/files/papers/YOLO9000.pdf
https://pjreddie.com/media/files/papers/YOLOv3.pdf

@TheMikeyR
Can you share one of your dataset that you used for training?

@abdulkalam1233 let me refer to this excellent article on how to train yolo on a custom dataset https://timebutt.github.io/static/how-to-train-yolov2-to-detect-custom-objects/
For multi classes dataset, this helped me getting started http://guanghan.info/blog/en/my-works/train-yolo/

@TheMikeyR
Thank you

@TheMikeyR
how can I add an extra dataset to the final weight file?
means how to train final weight file without losing the previous weights?

Hi @abdulkalam1233 ,
I suppose one valid approach would be to mix both datasets in the training process.
Maybe that would be good for better generalization power when testing in a third dataset. At the same time, I also suppose that testing that model in just one of the trained datasets would provide worse score compared to the model trained specifically for that dataset.
In summary, you would have a generalization gain but would have a loss for those specific datasets.

That is what I think. If you have tested or will test that, would be nice to share the results with us ;D

Tiny YOLO V2:

as explained on https://github.com/dwaithe/yolov2 the pre trained weight tiny can be generated using

darknet.exe partial cfg/tiny-yolo-voc.cfg tiny-yolo-voc.weights tiny-yolo-voc.conv.13 13

what is the “13” if I am training 5 objects do I need to change it ?

do I need to use my cfg file instead of tiny-yolo-voc.cfg?

thank you in advance

If the command doesn't exist in pjreddies repo then you can use alexeyab's repo instead. In Alexey's repo you are also able to train without any initialized weights, by issuing the train command without any weights (then it will initialize with random weights).

@TheMikeyR Hello, you mentioned in Alexey's repo can train without any initialized weights, why?
What's the effect between above and with parital weights in pjreddies repo ?
And you said it will initialize with random weights, does pjreddies repo have a initialize with random weights, if traing without any weights?
TheMikeyR, Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  ·  4Comments

gpsmit picture gpsmit  ·  3Comments

Vikalp-Reorder picture Vikalp-Reorder  ·  3Comments

arianaa30 picture arianaa30  ·  3Comments

sujithm picture sujithm  ·  3Comments