I've been experimenting with nearest neighbor algorithm for images with the style presented in this post (i.e. goal is to see how many nearly similar images there is). After getting the example adapted to my case running, I have seen couple of times the error "lmdb.BadRslotError: mdb_txn_begin: MDB_BAD_RSLOT: Invalid reuse of reader locktable slot" , and wondering what is the cause?
My hypothesis is that it was caused by opening the (same) lmdb twice in the same run (at least it hasn't appeared since fixing that), but not totally sure. One of the few search hits is given in another forum, but the answer is not definite.
So the error came from the .begin statement:
fn_lmdb = fn + '.lmdb' # stores word <-> id mapping
env = lmdb.open(fn_lmdb, map_size=int(1e9))
with env.begin() as txn:
...
At the moment after I moved open next to the begin, the error has not yet appeared, but not sure if I fixed the cause or just a symptom... Have you stumbled to this one, and what was the solution?
mdb_txn_begin
error, usinglock=False
fixed the issue. – Surly