I'm testing out YOLOv3 using the 'darknet' binary, and custom config. It trains rather slow.

My testing out is only with 1 image, 1 class, and using YOLOv3-tiny instead of YOLOv3 full, but the training of yolov3-tiny isn't fast as expected for 1 class/1 image.

The accuracy reached near 100% after like 3000 or 4000 batches, in similarly 3 to 4 hours.

Why is it slow with just 1 class/1 image?


I think you underestimate the size of YOLO. This is the size of one segment of yolo tiny according to the darknet .cfg file:

Convolutional Neural Network structure:
416x416x3                Input image
416x416x16               Convolutional layer: 3x3x16, stride = 1, padding = 1
208x208x16               Max pooling layer: 2x2, stride = 2
208x208x32               Convolutional layer: 3x3x32, stride = 1, padding = 1
104x104x32               Max pooling layer: 2x2, stride = 2
104x104x64               Convolutional layer: 3x3x64, stride = 1, padding = 1
52x52x64                 Max pooling layer: 2x2, stride = 2
52x52x128                Convolutional layer: 3x3x128, stride = 1, padding = 1
26x26x128                Max pooling layer: 2x2, stride = 2
26x26x256                Convolutional layer: 3x3x256, stride = 1, padding = 1
13x13x256                Max pooling layer: 2x2, stride = 2
13x13x512                Convolutional layer: 3x3x512, stride = 1, padding = 1
12x12x512                Max pooling layer: 2x2, stride = 1
12x12x1024               Convolutional layer: 3x3x1024, stride = 1, padding = 1

.cfg file found here: https://github.com/pjreddie/darknet/blob/master/cfg/yolov3-tiny.cfg

EDIT: These networks generally aren't specifically designed to train fast, they're designed to run fast at test time, where it matters

| improve this answer | |
  • $\begingroup$ yeah, that tiny network is still huge $\endgroup$ – datdinhquoc Feb 28 at 11:08

It depends upon the factors such as 1. Batch size (GPU memory capacity) 2. CPU speed and number of cores(multi-threading to load the images)

Number of classes increase the number of convolution filters only in the prediction layers of YOLO. It influences only less than 1% speed of the detector to train the model.

| improve this answer | |
  • $\begingroup$ u said it right, i train now on gpu and it's 10x to 100x faster $\endgroup$ – datdinhquoc Feb 28 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.