Skip to content

Commit 9bbfa1c

Browse files
committed
even more lsun perf fixes
1 parent 261483f commit 9bbfa1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchvision/datasets/lsun.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class LSUNClass(data.Dataset):
1414
def __init__(self, db_path, transform=None, target_transform=None):
1515
import lmdb
1616
self.db_path = db_path
17-
self.env = lmdb.open(db_path, max_readers=1, readonly=True, lock=False)
17+
self.env = lmdb.open(db_path, max_readers=1, readonly=True, lock=False,
18+
readahead=False, meminit=False)
1819
with self.env.begin(write=False) as txn:
1920
self.length = txn.stat()['entries']
2021
cache_file = '_cache_' + db_path.replace('/', '_')

0 commit comments

Comments
 (0)