"docs/vscode:/vscode.git/clone" did not exist on "6272c412cb6a4f5dbe69b1bc588ac3cfeb77c1cb"
Commit 261483fb authored by soumith's avatar soumith
Browse files

better options for lmdb

parent 248e2f0c
...@@ -14,8 +14,7 @@ class LSUNClass(data.Dataset): ...@@ -14,8 +14,7 @@ class LSUNClass(data.Dataset):
def __init__(self, db_path, transform=None, target_transform=None): def __init__(self, db_path, transform=None, target_transform=None):
import lmdb import lmdb
self.db_path = db_path self.db_path = db_path
self.env = lmdb.open(db_path, map_size=1099511627776, self.env = lmdb.open(db_path, max_readers=1, readonly=True, lock=False)
max_readers=100, readonly=True)
with self.env.begin(write=False) as txn: with self.env.begin(write=False) as txn:
self.length = txn.stat()['entries'] self.length = txn.stat()['entries']
cache_file = '_cache_' + db_path.replace('/', '_') cache_file = '_cache_' + db_path.replace('/', '_')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment