AlexeyAB / yolo-windows

a yolo windows version(for object detection)
71 stars 58 forks source link

I didn't get any detcted boxes after training new data #2

Closed anas-899 closed 7 years ago

anas-899 commented 8 years ago

I trained new data using "train_yolo" method, I changed the 'CLASSNUM' in yolo.c and 'classes' in .cfg file Then changed output in .cfg in [connected] based on this equation (5 * 2 + C) * S * S

after training 600 batches I tested the "yolo_600.weight" file and It didn't detect anything

I used same .cfg file of training for testing..

how many batches I should train until I start get any result? is there any another steps I should made? I even put "-thresh 0" and didn't get any box?? there is an article said that I should change CLS_NUM in yolo_kernels.cu as well .. but I didn't see this parameter?

AlexeyAB commented 8 years ago

@anas-899 Yes, should be in .cfg: output= (5 x 2 + C) x S x S classes= C side= S

  1. In my fork in yolo.c, CLASSNUM should be not less than classes, everything else in source code is automatically set
  2. use only jpeg and jpg format for training
  3. train at least 1000 batches
  4. for training use pretrained conv-model: http://pjreddie.com/media/files/extraction.conv.weights

If you get NAN when you training, or when you are trying to continue training from checkpoint: https://groups.google.com/forum/#!searchin/darknet/NAN|sort:relevance/darknet/-5DRax1SS2w/aDjRl15HEAAJ

anas-899 commented 8 years ago

@AlexeyAB Thanks a lot for your fast replay. Actually I tried everything but the training on windows is not giving any correct .weight file I tried to train the data and same example of : http://guanghan.info/blog/en/my-works/train-yolo/ but actually the output weight file didn't detect anything

I think the only way to success is by training over Linux

anas-899 commented 7 years ago

I solved the saving weight issue. It needs to change in two positions: first: src/parser.c you should change the line FILE fp = fopen(filename, "w"); to FILE fp = fopen(filename, "wb");

second: src/utils.c you should change the line if(c==' '||c=='\t'||c=='\n') ++offset; to if(c==' '||c=='\t'||c=='\n'||c=='\r') ++offset;

then the training on windows will save the weight correctly.

AlexeyAB commented 7 years ago

@anas-899 Thank you! I added this fix to rep.