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
a027b8de
Commit
a027b8de
authored
Jul 06, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try a different way handling lmdb size
parent
13e3c39a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
examples/Inception/inception-bn.py
examples/Inception/inception-bn.py
+1
-1
tensorpack/dataflow/dataset/ilsvrc.py
tensorpack/dataflow/dataset/ilsvrc.py
+4
-2
tensorpack/models/__init__.py
tensorpack/models/__init__.py
+2
-2
No files found.
examples/Inception/inception-bn.py
View file @
a027b8de
...
@@ -144,7 +144,7 @@ def get_data(train_or_test):
...
@@ -144,7 +144,7 @@ def get_data(train_or_test):
ds
=
AugmentImageComponent
(
ds
,
augmentors
)
ds
=
AugmentImageComponent
(
ds
,
augmentors
)
ds
=
BatchData
(
ds
,
BATCH_SIZE
,
remainder
=
not
isTrain
)
ds
=
BatchData
(
ds
,
BATCH_SIZE
,
remainder
=
not
isTrain
)
if
isTrain
:
if
isTrain
:
ds
=
PrefetchData
(
ds
,
20
,
5
)
ds
=
PrefetchData
ZMQ
(
ds
,
5
)
return
ds
return
ds
...
...
tensorpack/dataflow/dataset/ilsvrc.py
View file @
a027b8de
...
@@ -146,16 +146,18 @@ class ILSVRC12CaffeLMDB(DataFlow):
...
@@ -146,16 +146,18 @@ class ILSVRC12CaffeLMDB(DataFlow):
self
.
_meta
=
ILSVRCMeta
()
self
.
_meta
=
ILSVRCMeta
()
self
.
_shuffle
=
shuffle
self
.
_shuffle
=
shuffle
self
.
rng
=
get_rng
(
self
)
self
.
rng
=
get_rng
(
self
)
self
.
_txn
=
self
.
_lmdb
.
begin
()
self
.
_size
=
self
.
_txn
.
stat
()[
'entries'
]
if
shuffle
:
if
shuffle
:
with
timed_operation
(
"Loading LMDB keys ..."
):
with
timed_operation
(
"Loading LMDB keys ..."
):
self
.
keys
=
[
k
for
k
,
_
in
self
.
_
lmdb
.
begin
()
.
cursor
()]
self
.
keys
=
[
k
for
k
,
_
in
self
.
_
txn
.
cursor
()]
def
reset_state
(
self
):
def
reset_state
(
self
):
self
.
_txn
=
self
.
_lmdb
.
begin
()
self
.
_txn
=
self
.
_lmdb
.
begin
()
self
.
rng
=
get_rng
(
self
)
self
.
rng
=
get_rng
(
self
)
def
size
(
self
):
def
size
(
self
):
return
self
.
_
txn
.
stat
()[
'entries'
]
return
self
.
_
size
def
get_data
(
self
):
def
get_data
(
self
):
import
imp
import
imp
...
...
tensorpack/models/__init__.py
View file @
a027b8de
...
@@ -48,14 +48,14 @@ class LinearWrap(object):
...
@@ -48,14 +48,14 @@ class LinearWrap(object):
def
__getattr__
(
self
,
layer_name
):
def
__getattr__
(
self
,
layer_name
):
layer
=
eval
(
layer_name
)
layer
=
eval
(
layer_name
)
if
hasattr
(
layer
,
'f'
):
if
hasattr
(
layer
,
'f'
):
# a registered tensorpack layer
#
this is
a registered tensorpack layer
def
f
(
name
,
*
args
,
**
kwargs
):
def
f
(
name
,
*
args
,
**
kwargs
):
ret
=
layer
(
name
,
self
.
_t
,
*
args
,
**
kwargs
)
ret
=
layer
(
name
,
self
.
_t
,
*
args
,
**
kwargs
)
return
LinearWrap
(
ret
)
return
LinearWrap
(
ret
)
return
f
return
f
else
:
else
:
if
layer_name
!=
'tf'
:
if
layer_name
!=
'tf'
:
logger
.
warn
(
"You're calling LinearWrap.__getattr__ with something neither a layer nor 'tf'
. Not officially supported yet
!"
)
logger
.
warn
(
"You're calling LinearWrap.__getattr__ with something neither a layer nor 'tf'!"
)
assert
isinstance
(
layer
,
ModuleType
)
assert
isinstance
(
layer
,
ModuleType
)
return
LinearWrap
.
TFModuleFunc
(
layer
,
self
.
_t
)
return
LinearWrap
.
TFModuleFunc
(
layer
,
self
.
_t
)
...
...
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