Skip to content

FAQ frequently asked questions

Alexey edited this page Jun 9, 2020 · 3 revisions
  1. I get low accuracy
  2. Darknet training/detection crashes with an error

1. I get low accuracy:

  1. The most common problem - you do not follow strictly the manual. You must use: default anchors, learning_rate=0.001, batch=64 (you can change only subdivisions=), max_batches = max(6000, number_of_training_images, 2000*classes) = and you must train this number of iterations equal to max_batches, ... read more Do not do anything that is not written in the manual.

  2. Your datasets are wrong - check the AP50 (average precision) for validation and training dataset by using command ./darknet detector map obj.data yolo.cfg yolo.weights

    • if you get high mAP for both Training and Validation datasets, but the network detects objects poorly in real life, then your training dataset is not representative - add more images from real life to it

    • if you get high mAP for Training dataset, but low for Validation dataset, then your Training dataset isn't suitable for Validation dataset, read paragraph 4

    • if you get low mAP for both Training and Validation datasets, then labels in your Training dataset are wrong, read paragraph 3

  3. Your dataset is wrong - run training with flag -show_imgs, i.e. ./darknet detector train ... -show_imgs do you see correct bounded boxes? Or check your dataset by using Yolo_mark tool: https://github.com/AlexeyAB/Yolo_mark

  4. Your training dataset doesn't suitable for your Test dataset:

    • Training dataset contains: cars (rear view) from distance 100m
    • Test dataset contains: cars (side view) from distance 5m
  5. You must compile Darknet with GPU support for training.

  6. After you have verified that you do not have these mistakes, create an Issue and provide all the necessary information: https://github.com/AlexeyAB/darknet/issues/new?assignees=&labels=Training+issue&template=training-issue---no-detections---nan-avg-loss---low-accuracy.md&title=

2. Darknet training/detection crashes with an error:

  1. Read error message, and try to understand the cause of the error.

  2. If CUDA Out of memory error occurs, then increase subdivisions= 2 times in cfg-file, but not higher than batch= (don't change batch). If it doesn't help - set random=0 and width=416 height=416 in cfg-file.

  3. Check content of files bad.list and bad_label.list if they exist near with ./darknet executable file.

  4. Do not move some files from Darknet folder - you may forget the necessary files.

  5. Download libraries CUDA, cuDNN, OpenCV, ... only from official sources. Don't download libs from other sites.

  6. Make sure that you do everything in accordance with the manual, and do not do anything that is not written in the manual.

  7. Sometimes there are bugs in the libraries CUDA/cuDNN. Try to use another version.

  8. Sometimes, there are Hardware bugs: https://github.com/AlexeyAB/darknet/issues?q=is%3Aissue+label%3A%22Hardware+bug%22+is%3Aclosed

  9. If it doesn't help - create an Issue: https://github.com/AlexeyAB/darknet/issues/new?assignees=&labels=&template=any-other-question-or-issue.md&title=