Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
9bbfa1c3
Commit
9bbfa1c3
authored
Nov 18, 2016
by
soumith
Browse files
even more lsun perf fixes
parent
261483fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
torchvision/datasets/lsun.py
torchvision/datasets/lsun.py
+2
-1
No files found.
torchvision/datasets/lsun.py
View file @
9bbfa1c3
...
@@ -14,7 +14,8 @@ class LSUNClass(data.Dataset):
...
@@ -14,7 +14,8 @@ 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
,
max_readers
=
1
,
readonly
=
True
,
lock
=
False
)
self
.
env
=
lmdb
.
open
(
db_path
,
max_readers
=
1
,
readonly
=
True
,
lock
=
False
,
readahead
=
False
,
meminit
=
False
)
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
(
'/'
,
'_'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment