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
ModelZoo
ResNet50_tensorflow
Commits
f7201d1a
Commit
f7201d1a
authored
May 13, 2022
by
Scott Zhu
Committed by
A. Unique TensorFlower
May 13, 2022
Browse files
Prepare for upcoming keras initializer change.
PiperOrigin-RevId: 448506063
parent
231c6bd0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
official/projects/edgetpu/vision/modeling/custom_layers.py
official/projects/edgetpu/vision/modeling/custom_layers.py
+4
-2
No files found.
official/projects/edgetpu/vision/modeling/custom_layers.py
View file @
f7201d1a
...
@@ -18,6 +18,8 @@ import inspect
...
@@ -18,6 +18,8 @@ import inspect
from
typing
import
Any
,
MutableMapping
,
Optional
,
Union
,
Tuple
from
typing
import
Any
,
MutableMapping
,
Optional
,
Union
,
Tuple
import
tensorflow
as
tf
import
tensorflow
as
tf
from
official.modeling
import
tf_utils
class
GroupConv2D
(
tf
.
keras
.
layers
.
Conv2D
):
class
GroupConv2D
(
tf
.
keras
.
layers
.
Conv2D
):
"""2D group convolution as a Keras Layer."""
"""2D group convolution as a Keras Layer."""
...
@@ -168,7 +170,7 @@ class GroupConv2D(tf.keras.layers.Conv2D):
...
@@ -168,7 +170,7 @@ class GroupConv2D(tf.keras.layers.Conv2D):
self
.
add_weight
(
self
.
add_weight
(
name
=
'kernel_{}'
.
format
(
g
),
name
=
'kernel_{}'
.
format
(
g
),
shape
=
self
.
group_kernel_shape
,
shape
=
self
.
group_kernel_shape
,
initializer
=
self
.
kernel_initializer
,
initializer
=
tf_utils
.
clone_initializer
(
self
.
kernel_initializer
)
,
regularizer
=
self
.
kernel_regularizer
,
regularizer
=
self
.
kernel_regularizer
,
constraint
=
self
.
kernel_constraint
,
constraint
=
self
.
kernel_constraint
,
trainable
=
True
,
trainable
=
True
,
...
@@ -178,7 +180,7 @@ class GroupConv2D(tf.keras.layers.Conv2D):
...
@@ -178,7 +180,7 @@ class GroupConv2D(tf.keras.layers.Conv2D):
self
.
add_weight
(
self
.
add_weight
(
name
=
'bias_{}'
.
format
(
g
),
name
=
'bias_{}'
.
format
(
g
),
shape
=
(
self
.
group_output_channel
,),
shape
=
(
self
.
group_output_channel
,),
initializer
=
self
.
bias_initializer
,
initializer
=
tf_utils
.
clone_initializer
(
self
.
bias_initializer
)
,
regularizer
=
self
.
bias_regularizer
,
regularizer
=
self
.
bias_regularizer
,
constraint
=
self
.
bias_constraint
,
constraint
=
self
.
bias_constraint
,
trainable
=
True
,
trainable
=
True
,
...
...
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