Creating LMDB to fine-tune VGG network

403 views
Skip to first unread message

robbyl...@gmail.com

unread,
Oct 18, 2015, 2:04:58 PM10/18/15
to Caffe Users

Hello Everyone,

I am struggling with the right way to create LMDB using python in order to fine-tune VGG-16. I can not use convert_imageset, because I am working on multi-label classification and have to create two DB for the data and the labels.
Modifying Yoann code at:

I can get everything to be read into Caffe right, but the network fails to converge. I am suspecting this is because I have not done the transformation from RGB->BGR and/or the mean subtraction right.
So the question is how to build the DB and define the input layer so that VGG-16 fine-tuning would work?

Right now I subtract the mean in the data layer, and save the images into LMDB with:
msk = np.array(cv2.imread(os.path.join(data_dir,in_)))
msk = msk[:,:,::-1]
msk = msk.transpose((2,0,1))
msk_dat = caffe.io.array_to_datum(msk)
in_txn.put('{:0>10d}'.format(1000*idx + in_idx), msk_dat.SerializeToString())

It should be noted that I am fine tuning the fine-tuned version of VGG-16 for faces:
They are not mentioning how to input the data, so I assume it is exactly as VGG-16 (how can you check this type of stuff btw?)

Thanks a lot!



xie...@gmail.com

unread,
Jan 8, 2016, 1:28:31 AM1/8/16
to Caffe Users
Hello, I came with the same problem.

And, I have another question, what is your solver.prototxt like since no solver.prototxt is provided from the model.

在 2015年10月19日星期一 UTC+8上午2:04:58,Robert Byler写道:
Reply all
Reply to author
Forward
0 new messages