caffe icon indicating copy to clipboard operation
caffe copied to clipboard

what is batch_size mean?

Open liguanbin opened this issue 12 years ago • 3 comments

hi, can someone tell me what is "batch_size" mean in the protobuf definitions?

liguanbin avatar Jul 02 '14 16:07 liguanbin

Every iteration caffe process a batch, in this case the batch_size is the number of images that each batch will contain.

ssierral avatar Jul 03 '14 07:07 ssierral

Greetings,

I have the same question, I understood "batch_size" in the protobuf definitions but what is its significance during feature extraction phase? I followed the feature extraction tutorial and even though I am extracting features for one image (examples/images/cat.jpg) at the output it shows 500 query images processed, what does this mean?

Can someone shed some light on this?

Thanks, Venky

Venkatesh-Murthy avatar Jul 13 '14 05:07 Venkatesh-Murthy

@Venkatesh-Murthy Caffe operates on batches of data in GPU mode to reduce the overhead of communicating between the host and device. The feature extraction example batch_size is set to 50, and when the tool is called it is given 10 iterations as its argument, so it is actually processing 500 inputs. Set the batch_size and iteration arg to both be 1 to process a single image, although that's less efficient in throughput.

Please continue the discussion on the caffe-users mailing list. As of the latest release we prefer to keep issues reserved for Caffe development. Thanks!

shelhamer avatar Aug 11 '14 23:08 shelhamer