Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
3d2e7d38
Commit
3d2e7d38
authored
Apr 01, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix size count in LMDBData
parent
9af1c032
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
.travis.yml
.travis.yml
+2
-2
tensorpack/dataflow/format.py
tensorpack/dataflow/format.py
+10
-6
No files found.
.travis.yml
View file @
3d2e7d38
...
...
@@ -56,9 +56,9 @@ script:
notifications
:
-
email
:
recipients
:
-
ppwwyyxxc@gmail.com
-
ppwwyyxxc@gmail.com
on_success
:
never
on_failure
:
change
on_failure
:
always
-
webhooks
:
urls
:
-
https://webhooks.gitter.im/e/cede9dbbf6630b3704b3
...
...
tensorpack/dataflow/format.py
View file @
3d2e7d38
...
...
@@ -79,8 +79,9 @@ class LMDBData(RNGDataFlow):
self
.
_shuffle
=
shuffle
self
.
open_lmdb
()
logger
.
info
(
"Found {} entries in {}"
.
format
(
self
.
_size
,
self
.
_lmdb_path
))
self
.
_size
=
self
.
_txn
.
stat
()[
'entries'
]
self
.
_set_keys
(
keys
)
logger
.
info
(
"Found {} entries in {}"
.
format
(
self
.
_size
,
self
.
_lmdb_path
))
def
_set_keys
(
self
,
keys
=
None
):
def
find_keys
(
txn
,
size
):
...
...
@@ -94,12 +95,16 @@ class LMDBData(RNGDataFlow):
pbar
.
update
()
return
keys
try
:
self
.
keys
=
loads
(
self
.
_txn
.
get
(
'__keys__'
))
except
:
self
.
keys
=
None
else
:
self
.
_size
-=
1
# delete this item
if
self
.
_shuffle
:
if
keys
is
None
:
# get the list of keys either from __keys__ or by iterating
try
:
self
.
keys
=
loads
(
self
.
_txn
.
get
(
'__keys__'
))
except
Exception
:
if
self
.
keys
is
None
:
self
.
keys
=
find_keys
(
self
.
_txn
,
self
.
_size
)
else
:
# check if key-format like '{:0>8d}' was given
...
...
@@ -114,7 +119,6 @@ class LMDBData(RNGDataFlow):
readonly
=
True
,
lock
=
False
,
readahead
=
True
,
map_size
=
1099511627776
*
2
,
max_readers
=
100
)
self
.
_txn
=
self
.
_lmdb
.
begin
()
self
.
_size
=
self
.
_txn
.
stat
()[
'entries'
]
def
reset_state
(
self
):
self
.
_lmdb
.
close
()
...
...
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