Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anas-899 opened this issue Aug 24, 2016 · 4 comments
Closed

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

anas-899 opened this issue Aug 24, 2016 · 4 comments

Comments

@anas-899
Copy link

anas-899 commented Aug 24, 2016

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?

@anas-899 anas-899 changed the title no detected boxes after training new data I didn't get any detcted boxes after training new data Aug 24, 2016
@AlexeyAB
Copy link
Owner

AlexeyAB commented Aug 24, 2016

@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

  • reduce the learning rate(e.g. 1/10 of the origin), this can help (learning_rate= in .cfg file)
  • try to train on Linux (where the problem occurs much less frequently) by using https://github.com/pjreddie/darknet and then use already trained .weights for this fork yolo-windows

@anas-899
Copy link
Author

@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
Copy link
Author

anas-899 commented Aug 26, 2016

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants