Why does extracting features process 500 query files irrespective of the number of images inside /examples/images folder
I think I'm doing something wrong when I try to extract features. I'm following the instructions given in http://caffe.berkeleyvision.org/gathered/examples/feature_extraction.html to extract features using the pretrained imagenet model. My concern is that, irrespective of the number of images inside 'caffe/examples/images' folder, the code always ends with a text as follows.
%%%%% E0717 17:28:57.687183 10851 extract_features.cpp:157] Extracted features of 500 query images. E0717 17:28:57.687410 10851 extract_features.cpp:163] Successfully extracted the features! %%%%%
Cruicial is the number of query images. Why is it 500 images always? Am I missing a trick here? The size of the features leveldb also remains the same (about 10.2 mb) irrespective of the number of images in the 'images' folder.
Plesae also tell me if there is any other code (be it in matlab, python etc.) that I should try.
Many thanks, Abir
I am glad that you asked this question, @dasabir did you find out the reason for this?
Hi @Venkatesh-Murthy - No, not really. Trying different things, but no luck till now.
Hi @shelhamer , can you please explain the reason behind this?
Thanks in advance.
-Venky
How many lines are there in the generated "file_list.txt"? What is the batch size defined in the "imagenet_val.prototxt" and how many mini-batches do you run the script?
Note the last argument in the following command is the number of the mini-batches.
build/tools/extract_features.bin examples/imagenet/caffe_reference_imagenet_model examples/_temp/imagenet_val.prototxt fc7 examples/_temp/features 10
I have the same confusion here, the batchsize in prototxt file is 50 by default, and in that tutorial the last parameter for extracting feature is 10, which is minibatchsize, so that's why you keep getting 500. When i try to extract features for 8677 new images, this is what i get, fc7 is using 200 as minibatch size, fc7_2 is using 300 as minibatch size, batch size is 50 by default
fc7: total 200212 -rw-r--r--. 1 rzheng lab 205002872 Aug 7 01:22 000003.log -rw-r--r--. 1 rzheng lab 16 Aug 7 01:18 CURRENT -rw-r--r--. 1 rzheng lab 0 Aug 7 01:18 LOCK -rw-r--r--. 1 rzheng lab 57 Aug 7 01:18 LOG -rw-r--r--. 1 rzheng lab 50 Aug 7 01:22 MANIFEST-000002
fc7_2: total 390884 -rw-r--r--. 1 rzheng lab 287008462 Aug 7 01:30 000003.log -rw-r--r--. 1 rzheng lab 20501394 Aug 7 01:30 000004.log -rw-r--r--. 1 rzheng lab 92737475 Aug 7 01:30 000005.sst -rw-r--r--. 1 rzheng lab 16 Aug 7 01:24 CURRENT -rw-r--r--. 1 rzheng lab 0 Aug 7 01:24 LOCK -rw-r--r--. 1 rzheng lab 199 Aug 7 01:30 LOG -rw-r--r--. 1 rzheng lab 50 Aug 7 01:30 MANIFEST-000002
for 200 minibatch size, it says extracted features of 10000 query images, for 300 minibatch size, it says extrated features of 15000 query images, and it seems the size of extracted features grows while both of them are larger than 8677 images as input, i still don't know how to correctly specify these parameters, hope someone could help us with this :)
See https://github.com/BVLC/caffe/issues/585#issuecomment-51856173 for a description of the batch_size parameter and iteration argument for feature extraction.
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!
Is this thread solved. if yes please tell me how to correctly specify these params.