pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.72k stars 21.32k forks source link

Can i combine yolo.weights and my weights? #564

Open RushNuts opened 6 years ago

springkim commented 6 years ago

First answer : impossible. I think you are not talking about ensemble. You mean just add new class in weights. right? You have to train again using those data set. and consider base model(backbone) too.

Second answer : Same as Yolo v2. clone new source from this repository and just replace cfg. Visit https://github.com/AlexeyAB/darknet here. He wrote good document.

ahsan856jalal commented 6 years ago

change classes to 6 everywhere and change filters of all linear convolution layers to 33 ((6+5)*3) before that [yolo] layer. note: I am considering num=9

shwangdev commented 6 years ago

@RushNuts ,

how to launch the yolo weights and self geneated weights together at darknet startup? Thanks .

ahsan856jalal commented 6 years ago

If you mean your weights are trained on different classes and you want these classes and yolo trained classes then modify the cfg file (filters of linear convolution layer , classes ) and retrain on your dataset . Otherwise there is no way to use both weights at the run time

JackSnowWolf commented 6 years ago

@ahsan856jalal May I ask you a question about pretrained weights in the training ?

I am dealing with my own task with the help of YOLOV3. I have already changed number of class and amount of filter. Besides, I also changed anchors by using the k_means_yolo.py. The anchor size is decided by input image size and label box size. Here comes the question. During the training, although there are some nan, the Obj value is decreasing and No Obj value is increasing. However, the Obj value is about 0.00x and No Obj value is about 0.0000x. like:

_Region 106 Avg IOU: 0.660435, Class: 0.982275, Obj: 0.003900, No Obj: 0.000079, .25R: 1.000000, .5R: 0.833333, .75R: 0.166667, count: 6

Region 106 Avg IOU: 0.668969, Class: 0.999352, Obj: 0.110232, No Obj: 0.000182, .25R: 1.000000, .5R: 1.000000, .75R: 0.181818, count: 11_

Could you offer me some advice to improve the Obj value? BTW, I have already run more than 30000 batches.

THANK YOU VERY MUCH

ahsan856jalal commented 6 years ago

According to pjreddie and AlexeyAB ( my own experience as well) obj decreases in the start then after ~1000 iterations, it will start to increase. If the result you showed from the initial iterations , then wait for more iterations , it will increase

Regards Ahsan

On Tue, Apr 3, 2018 at 12:46 PM, JackSnowWolf notifications@github.com wrote:

@ahsan856jalal https://github.com/ahsan856jalal May I ask you a question about pretrained weights in the training ?

I am dealing with my own task with the help of YOLOV3. I have already changed number of class and amount of filter. Besides, I also changed anchors by using the k_means_yolo.py. The anchor size is decided by input image size and label box size. Here comes the question. During the training, although there are some nan, the Obj value is decreasing and No Obj value is increasing. However, the Obj value is about 0.00x and No Obj value is about 0.0000x. like:

_Region 106 Avg IOU: 0.660435, Class: 0.982275, Obj: 0.003900, No Obj: 0.000079, .25R: 1.000000, .5R: 0.833333, .75R: 0.166667, count: 6

Region 106 Avg IOU: 0.668969, Class: 0.999352, Obj: 0.110232, No Obj: 0.000182, .25R: 1.000000, .5R: 1.000000, .75R: 0.181818, count: 11_

Could you offer me some advice to improve the Obj value? BTW, I have already run more than 30000 batches.

THANK YOU VERY MUCH

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pjreddie/darknet/issues/564#issuecomment-378159266, or mute the thread https://github.com/notifications/unsubscribe-auth/AK9zjgLdaMA9vZNwNqR1HgLMOnv3APxlks5tkyjTgaJpZM4S6rOB .

JackSnowWolf commented 6 years ago

@ahsan856jalal Thank you very much! I will try.

mohammedsafiAyyuf commented 5 years ago

@ahsan856jalal Thank you very much! I will try.

hey does your obj values increased?

tibabs commented 4 years ago

Hi, I'm a newly on the Yolo world. As I understand it's impossible to combine to weights. The only way seems to combine datasets (images and corresponding txt files with x,y,w,h) and retrain the darknet. OK. So my question is : Is there any place (a GitHub repository for example) where guys leave their own datasets (cats, cars, people, trees, balls, bicycle ...) and where anybody could download them in order to train a darknet from scratch ? Thanks by advance.