reu2018DL / YOLO-LITE

All the trained models used while developing YOLO-LITE
360 stars 119 forks source link

How to use Yolo-Lite to train my datasets? #6

Open TianSong1991 opened 5 years ago

TianSong1991 commented 5 years ago

Hi reu2018DL, I use your tiny-yolov2-trial3-noBatch.cfg to train my datasets. I use the darknet of Yolo to train the model. I modify the learning_rate to 0.0001. And I modify the batch and subdivisions many times, but my model IOU is only 0.6. It is very difficult to improve it. My datasets is selected from voc datasets which includes people, car, motorbike, bus and bicycle, total 5 classes. My main question is how to improve the IOU higher and make the model show better.Thank you.

Favi0 commented 5 years ago

hello tian , im looking to do the same but didnt train my dataset yet.. did you solve it?

TianSong1991 commented 5 years ago

hello tian , im looking to do the same but didnt train my dataset yet.. did you solve it?

I train my dataset and I obtain the model, but the IOU is not perfect. My problem is to make the IOU reach 0.8 or more than 0.8. You can follow the voc example to train your dataset.

Favi0 commented 5 years ago

Hey tian thanks for answering. Where is the voc example? im trying to train it with alexei darknet but the commands doesnt seem to work could you give me a hint?

!./darknet detector train cfg/obj.data yoloLITE.cfg yoloLITE.weights -dont_show .. but this is more fore yoloV3 apparently

TianSong1991 commented 5 years ago

@Favi0 You should use the darknet. Next git clone the author's repository. I use the tiny-yolov2-trial3-noBatch.cfg model which is in cfg file and move it to darknet cfg file.Use ./darknet detector train cfg/myown.data cfg/tiny-yolov2-trial3-noBatch.cfg -gpus 0,1 to train your own data.

Favi0 commented 5 years ago

well... 12 hours of training and cant surpass the 20% IoU average and 35% MAP with 2k images and 1 class and its stuck at the same loss so whatever you r doing your values are great lol

Jped commented 5 years ago

Hi with regards to improving the IOU, I am not sure if I have a guaranteed solution. We changed cut our input image size in half (you can see that in the cfg file), maybe you can try doubling it back up and seeing if that makes any difference.

Dantetheash commented 5 years ago

hello there, I am new here and I was trying to use YOLO-lite for a personal project I have my own data set but I don't know how to train YOLO-lite I have searched around and all I could find is YOLOV2 or YOLOV3, I want to train it on custom objects and I don't know what cfg file I should use and what convolutional wights should I use in the training process?

Jped commented 5 years ago

You should use the cfg named tiny-yolov2-trial3-noBatch.cfg if you are training on your own data you do not want to use any pretrained weights.

Dantetheash commented 5 years ago

okay, so I tried tiny-yplpv2-trial3-nobactch.cfg I have a dataset of 2 objects and I am using cpu to train here are the changes I made on the cfg file Training batch=32 >> 24 subdivisions=1 >> 8

[convolutional] (note: last layer) size=1 stride=1 pad=1 filters=125 >> 35 activation=linear

[region] anchors = 1.08,1.19, 3.42,4.41, 6.63,11.38, 9.42,5.11, 16.62,10.52 bias_match=1 classes=20 >> 2 coords=4 num=5 softmax=1 jitter=.2 rescore=0

when I start training I have an average loss of 347.999298 and it keeps increasing here is a line 20: 516.840637, 462.770935 avg, 0.000000 rate, 35.075226 seconds, 480 images what is the issue here?

Favi0 commented 5 years ago

leave it training for a couple of hours and check again

also ... if you are using alexeyAB's darknet , change the size of yours anchors

Dantetheash commented 5 years ago

I left it training for 12 hours but the same result my avg is not decreasing at all And how should I the size of the anchors?

Favi0 commented 5 years ago

there is another repo of darknet

AlexeyAB https://github.com/AlexeyAB/darknet

yolo lite weights were trained using it , its almost the same than the original but with some improvements... check it out for the command to calculate the anchors sizes for you using KNN then paste in your .cfg file

Favi0 commented 5 years ago

To calculate anchors: ./darknet detector calc_anchors data/obj.data -num_of_clusters ... -width ... -height ...

wzj5133329 commented 5 years ago

Excuse me, when I was training a class in VOC,Loss can only go down to about 20,why? i use the learning rate from 0.002-0.000002.

Region Avg IOU: 0.581684, Class: 1.000000, Obj: 0.551396, No Obj: 0.009609, Avg Recall: 0.753623, count: 69 Region Avg IOU: 0.625079, Class: 1.000000, Obj: 0.409222, No Obj: 0.012080, Avg Recall: 0.833333, count: 78 Region Avg IOU: 0.589875, Class: 1.000000, Obj: 0.403203, No Obj: 0.011038, Avg Recall: 0.743243, count: 74 Region Avg IOU: 0.587966, Class: 1.000000, Obj: 0.576078, No Obj: 0.011113, Avg Recall: 0.692308, count: 78 Region Avg IOU: 0.586635, Class: 1.000000, Obj: 0.481019, No Obj: 0.008804, Avg Recall: 0.694915, count: 59 Region Avg IOU: 0.606571, Class: 1.000000, Obj: 0.462630, No Obj: 0.010388, Avg Recall: 0.736842, count: 76 Region Avg IOU: 0.609203, Class: 1.000000, Obj: 0.460906, No Obj: 0.010148, Avg Recall: 0.754386, count: 57 Region Avg IOU: 0.600682, Class: 1.000000, Obj: 0.504916, No Obj: 0.010349, Avg Recall: 0.771429, count: 70 30809: 24.904362, 27.011528 avg, 0.000002 rate, 0.676079 seconds, 7887104 images Loaded: 0.000054 seconds Region Avg IOU: 0.602135, Class: 1.000000, Obj: 0.486835, No Obj: 0.010120, Avg Recall: 0.694915, count: 59 Region Avg IOU: 0.653022, Class: 1.000000, Obj: 0.464958, No Obj: 0.011195, Avg Recall: 0.833333, count: 60 Region Avg IOU: 0.561357, Class: 1.000000, Obj: 0.608133, No Obj: 0.008909, Avg Recall: 0.720588, count: 68 Region Avg IOU: 0.587153, Class: 1.000000, Obj: 0.556084, No Obj: 0.011287, Avg Recall: 0.738462, count: 65 Region Avg IOU: 0.583006, Class: 1.000000, Obj: 0.470630, No Obj: 0.010304, Avg Recall: 0.696429, count: 56 Region Avg IOU: 0.565699, Class: 1.000000, Obj: 0.674786, No Obj: 0.010346, Avg Recall: 0.727273, count: 66 Region Avg IOU: 0.592734, Class: 1.000000, Obj: 0.457988, No Obj: 0.011185, Avg Recall: 0.790323, count: 62 Region Avg IOU: 0.611833, Class: 1.000000, Obj: 0.618833, No Obj: 0.011206, Avg Recall: 0.779412, count: 68 30810: 19.427305, 26.253105 avg, 0.000002 rate, 0.657625 seconds, 7887360 images

haithink commented 4 years ago

You should use the cfg named tiny-yolov2-trial3-noBatch.cfg if you are training on your own data you do not want to use any pretrained weights.

Thanks a lot. I use tiny-yolov2-trial3-noBatch.cfg instead of trial6.cfg, mAP of model increased quickly!

haithink commented 4 years ago

Very strange. In one class detection case, if learning_rate is 0.0002, loss can be very low, but mAP is zero. Then i change learning_rate to 0.001, mAP is normal. But in two class detection case, mAP is always zero.....