This is an example to show how to write and read lmdb file for caffe with python. You can use cv2 to read your own image data.
Post some my github code piece here.
This script is useful to create leveldb/lmdb data in caffe.
Sometimes we want to normalize the data in one layer, especially L2 Normalization. However, there is not such layer in caffe, so I write the simple layer with the inspiration from the most similar layer called SoftmaxLayer.
Useful code for caffe