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
1cd536a9
Commit
1cd536a9
authored
Aug 08, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable autograph in prelu as well
parent
0c53df74
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
+12
-9
tensorpack/models/batch_norm.py
tensorpack/models/batch_norm.py
+1
-9
tensorpack/models/nonlin.py
tensorpack/models/nonlin.py
+2
-0
tensorpack/models/utils.py
tensorpack/models/utils.py
+9
-0
No files found.
tensorpack/models/batch_norm.py
View file @
1cd536a9
...
@@ -15,6 +15,7 @@ from ..utils.argtools import get_data_format
...
@@ -15,6 +15,7 @@ from ..utils.argtools import get_data_format
from
..utils.develop
import
log_deprecated
from
..utils.develop
import
log_deprecated
from
.common
import
VariableHolder
,
layer_register
from
.common
import
VariableHolder
,
layer_register
from
.tflayer
import
convert_to_tflayer_args
,
rename_get_variable
from
.tflayer
import
convert_to_tflayer_args
,
rename_get_variable
from
.utils
import
disable_autograph
__all__
=
[
'BatchNorm'
,
'BatchRenorm'
]
__all__
=
[
'BatchNorm'
,
'BatchRenorm'
]
...
@@ -60,15 +61,6 @@ def internal_update_bn_ema(xn, batch_mean, batch_var,
...
@@ -60,15 +61,6 @@ def internal_update_bn_ema(xn, batch_mean, batch_var,
return
tf
.
identity
(
xn
,
name
=
'output'
)
return
tf
.
identity
(
xn
,
name
=
'output'
)
try
:
# When BN is used as an activation, keras layers try to autograph.convert it
# This leads to massive warnings so we disable it.
from
tensorflow.python.autograph.impl.api
import
do_not_convert
as
disable_autograph
except
ImportError
:
def
disable_autograph
():
return
lambda
x
:
x
@
layer_register
()
@
layer_register
()
@
convert_to_tflayer_args
(
@
convert_to_tflayer_args
(
args_names
=
[],
args_names
=
[],
...
...
tensorpack/models/nonlin.py
View file @
1cd536a9
...
@@ -8,6 +8,7 @@ from ..utils.develop import log_deprecated
...
@@ -8,6 +8,7 @@ from ..utils.develop import log_deprecated
from
..compat
import
tfv1
from
..compat
import
tfv1
from
.batch_norm
import
BatchNorm
from
.batch_norm
import
BatchNorm
from
.common
import
VariableHolder
,
layer_register
from
.common
import
VariableHolder
,
layer_register
from
.utils
import
disable_autograph
__all__
=
[
'Maxout'
,
'PReLU'
,
'BNReLU'
]
__all__
=
[
'Maxout'
,
'PReLU'
,
'BNReLU'
]
...
@@ -37,6 +38,7 @@ def Maxout(x, num_unit):
...
@@ -37,6 +38,7 @@ def Maxout(x, num_unit):
@
layer_register
()
@
layer_register
()
@
disable_autograph
()
def
PReLU
(
x
,
init
=
0.001
,
name
=
None
):
def
PReLU
(
x
,
init
=
0.001
,
name
=
None
):
"""
"""
Parameterized ReLU as in the paper `Delving Deep into Rectifiers: Surpassing
Parameterized ReLU as in the paper `Delving Deep into Rectifiers: Surpassing
...
...
tensorpack/models/utils.py
View file @
1cd536a9
...
@@ -35,3 +35,12 @@ class VariableHolder(object):
...
@@ -35,3 +35,12 @@ class VariableHolder(object):
list of all variables
list of all variables
"""
"""
return
list
(
six
.
itervalues
(
self
.
_vars
))
return
list
(
six
.
itervalues
(
self
.
_vars
))
try
:
# When BN is used as an activation, keras layers try to autograph.convert it
# This leads to massive warnings so we disable it.
from
tensorflow.python.autograph.impl.api
import
do_not_convert
as
disable_autograph
except
ImportError
:
def
disable_autograph
():
return
lambda
x
:
x
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