Reputation: 61
I'm trying to edit labels in my own lmdb-database for caffe in python:
def WriteLMDB(lmdbpath):
lmdb_env = lmdb.open(lmdbpath)
lmdb_txn = lmdb_env.begin(write=True)
lmdb_cursor = lmdb_txn.cursor()
datum = caffe_pb2.Datum()
for key, value in lmdb_cursor:
datum.ParseFromString(value)
datum.label = 100
lmdb_txn.put(key, datum.SerializeToString())
lmdb_txn.commit
But when I run it, I have error:
mdb_put: MDB_MAP_FULL: Environment mapsize limit reached
I have the same error when I am just trying to delete record by it's key:
lmdb_txn.delete(key)
Can anybody explain me, what I am doing wrong?
Upvotes: 1
Views: 2916
Reputation: 387
The problem is the current map size of your env is not able to accommodate the growth of your database when your are performing write operations. The default map size provided by lmdb is low. So you have to specify bigger map size when opening your env... using lmdb.open(path, map_size = size) where size containing the map size of env..
You can also increase the map size using the function set_mapsize(map_size) on env object.. You can find this function in the following link lmdb python docs....To accommodate future growth of database you can give map size to big value like 1GB...
Upvotes: 1