Search code examples
conv-neural-networkobject-detectionyolo

When we implement YOLOv2 in darknet, after every 10 epochs, the image size is changed. How is this happening?


In YOLO v2, after every 10 epochs, the network randomly chooses a size How is this happening in darknet? I'm using ubuntu 18.04


Solution

  • I think the network sized is changed every 10 iterations (not epochs).
    In your cfg file, check the random flag.

    random = 1 means Yolo changes the network size for every 10 iterations, it is useful to increase precision by training the network on different resolution.

    According to Yolo paper :

    However, since our model only uses convolutional and pooling layers it can be resized on the fly. We want YOLOv2 to be robust to running on images of different sizes so we train this into the model. Instead of fixing the input image size we change the network every few iterations. Every 10 batches our network randomly chooses a new image dimension size. Since our model downsamples by a factor of 32, we pull from the following multiples of 32: {320, 352, ..., 608}. Thus the smallest option is 320 × 320 and the largest is 608 × 608. We resize the network to that dimension and continue training.