BVLC/caffe — pull request #1324 by jyegerlehner (2014-10-19 15:42:06+00:00)
Title: extract_features: fix crash when exporting multiple features

The problem is when we obtaining the db_type argument to pass to database factory: arg_pos keeps getting incremented as we loop through num_features. It works when num_features=1, but on successive iterations of the loop the arg_pos increments past the location of the db_type argument.

I also changed the number of images whose features are cached in memory before committing to disk. Prior to this change, it was hard-wired to 1000. For large nets with lots of conv channels that gets to be a lot of memory. There's no reason to keep so much in memory before writing out to disk. So I replaced the literal 1000 with an optional command-line-argument-selectable size that defaults to 100. Makes the difference between an export that crashes upon memory starvation on my 8GB machine, and one that succeeds.