I tried to do this, using Yoann's code, but either I'm not actually opening the lmdb or something similar is occuring. My only change to Yoann's code is to define the path of the mnist lmdb:
db_path = '/home/mroos/caffe-master/examples/mnist/mnist_train_lmdb/'
But after trying to open and read from the lmdb, the returned value and key are empty strings:
>>> lmdb_cursor = lmdb_txn.cursor() # equivalent to mdb_cursor_open()
>>> lmdb_cursor.get('{:0>10d}'.format(1)) # get the data associated with the 'key' 1, change the value to get other images
>>> value = lmdb_cursor.value()
>>> key = lmdb_cursor.key()
>>> value
''
>>> key
''
I'm not getting any errors. I'm a novice to python and know almost nothing about DBs, so any suggestions would be appreciated!