简体   繁体   中英

Creating an LMDB in Python without Caffe

I've been following this tutorial for creating LMDBs in Python. The code in the tutorial depends on Caffe, namely the caffe.proto.caffe_pb2.Datum() object for serializing the data.

However, those not using Caffe as a deep learning framework might find it tedious to install Caffe just for using the protobuf. What other ways exist for creating LMDBs?

LMDB is a general purpose DB that can be used for many applications in many ways. However, if you want to use it with caffe you are restricted to the interface written in caffe's "Data" layer. This interface is expecting a "Datum" elements in the LMDB. Other stored elements in the LMDB will simply results with a read error by caffe failing to interpret the stored elements.

Therefore, if you are going to use LMDB as an input for a caffe "Data" layer, you must store elements as "Datum" in the LMDB.
However, if you are going to use LMDB for other purposes, you may store any type of objects you wish, as long as you know how to read them correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM