Kritika Garg
Kritika Garg

Reputation: 71

how to resolve lmdb.Error: mdb_txn_commit: Input/output error?

I was creating lmdb database for images with labels. My code is follows:

 with in_db.begin(write=True) as in_txn:
    for in_idx, img_path in enumerate(X):
        img = cv2.imread(img_path, cv2.IMREAD_COLOR)
        #print(Y_gender[in_idx])
        label = int(Y_gender[in_idx])
        datum = make_datum(img, label)
        in_txn.put('{:0>8d}'.format(in_idx), datum.SerializeToString())
        #print '{:0>8d}'.format(in_idx) + ':' + img_path
in_db.close()

and I am getting following error:

Traceback (most recent call last):
File "create_lmdb_faces.py", line 40, in <module>
in_txn.put('{:0>8d}'.format(in_idx), datum.SerializeToString())
lmdb.Error: mdb_txn_commit: Input/output error

How can I fix this error?

Upvotes: 3

Views: 2370

Answers (1)

Hazem
Hazem

Reputation: 550

You could be running out of disk space. The .mdb file is huge. This is the closest answer I could get for my situation. Not sure about your case. Simply write to another disk.

Check this answer from Google groups

Upvotes: 5

Related Questions