What happens when the number of images is less than the batch size? #8069
-
Say I have 50 images for training, but the batch size is set to 64, does the network fill the gap with augmented images? Does it just duplicate existing images from the same iteration? Or does it do something else? What if I had much less, say 5 images, and the batch size is 64. What happens then? Is it any different from the example with 50 images? I ask this question because I am doing some testing with very small datasets and I'm curious how darknet handles a batch size that is greater than the number of images listed in train.txt. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@AlexeyAB I also have the same doubt please answer this |
Beta Was this translation helpful? Give feedback.
-
Yes. My understanding is once it has reached the end of the images, if max batches has not been met then it starts again from the start. So if you have a dataset with a single image, but batch size is 64 and max batches is 6000, you'll end up with lots of copies of the original image with all sorts of data augmentation from flip=1, hue=0.1, saturation=1.5, etc. This could probably be tested by using the |
Beta Was this translation helpful? Give feedback.
Yes.
My understanding is once it has reached the end of the images, if max batches has not been met then it starts again from the start. So if you have a dataset with a single image, but batch size is 64 and max batches is 6000, you'll end up with lots of copies of the original image with all sorts of data augmentation from flip=1, hue=0.1, saturation=1.5, etc.
This could probably be tested by using the
-show_imgs
flag when training.