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
e9dbffec
Commit
e9dbffec
authored
Apr 22, 2022
by
Fan Yang
Committed by
A. Unique TensorFlower
Apr 22, 2022
Browse files
Internal change
PiperOrigin-RevId: 443724012
parent
0944cb79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
official/projects/qat/vision/modeling/layers/nn_layers.py
official/projects/qat/vision/modeling/layers/nn_layers.py
+5
-4
No files found.
official/projects/qat/vision/modeling/layers/nn_layers.py
View file @
e9dbffec
...
@@ -396,11 +396,12 @@ class SegmentationHeadQuantized(tf.keras.layers.Layer):
...
@@ -396,11 +396,12 @@ class SegmentationHeadQuantized(tf.keras.layers.Layer):
size
=
(
self
.
_config_dict
[
'upsample_factor'
],
size
=
(
self
.
_config_dict
[
'upsample_factor'
],
self
.
_config_dict
[
'upsample_factor'
]),
self
.
_config_dict
[
'upsample_factor'
]),
interpolation
=
'nearest'
)
interpolation
=
'nearest'
)
self
.
_resizing_layer
=
tf
.
keras
.
lay
er
s
.
Resizing
(
self
.
_resizing_layer
=
help
er
.
Resizing
Quantized
(
backbone_shape
[
1
],
backbone_shape
[
2
],
interpolation
=
'bilinear'
)
backbone_shape
[
1
],
backbone_shape
[
2
],
interpolation
=
'bilinear'
)
self
.
_concat_layer
=
helper
.
ConcatenateQuantized
(
axis
=
self
.
_bn_axis
)
self
.
_concat_layer
=
helper
.
ConcatenateQuantized
(
axis
=
self
.
_bn_axis
)
self
.
_add_layer
=
tf
.
keras
.
layers
.
Add
()
self
.
_add_layer
=
tfmot
.
quantization
.
keras
.
QuantizeWrapperV2
(
tf
.
keras
.
layers
.
Add
(),
configs
.
Default8BitQuantizeConfig
([],
[],
True
))
super
().
build
(
input_shape
)
super
().
build
(
input_shape
)
...
@@ -638,7 +639,7 @@ class SpatialPyramidPoolingQuantized(nn_layers.SpatialPyramidPooling):
...
@@ -638,7 +639,7 @@ class SpatialPyramidPoolingQuantized(nn_layers.SpatialPyramidPooling):
kernel_regularizer
=
self
.
_kernel_regularizer
,
kernel_regularizer
=
self
.
_kernel_regularizer
,
use_bias
=
False
,
use_bias
=
False
,
activation
=
helper
.
NoOpActivation
()),
activation
=
helper
.
NoOpActivation
()),
norm
_with_quantize
(
norm
(
axis
=
self
.
_bn_axis
,
axis
=
self
.
_bn_axis
,
momentum
=
self
.
_batchnorm_momentum
,
momentum
=
self
.
_batchnorm_momentum
,
epsilon
=
self
.
_batchnorm_epsilon
)
epsilon
=
self
.
_batchnorm_epsilon
)
...
@@ -667,7 +668,7 @@ class SpatialPyramidPoolingQuantized(nn_layers.SpatialPyramidPooling):
...
@@ -667,7 +668,7 @@ class SpatialPyramidPoolingQuantized(nn_layers.SpatialPyramidPooling):
x
=
self
.
_concat_layer
(
result
)
x
=
self
.
_concat_layer
(
result
)
for
layer
in
self
.
_projection
:
for
layer
in
self
.
_projection
:
x
=
layer
(
x
,
training
=
training
)
x
=
layer
(
x
,
training
=
training
)
x
=
self
.
_activation_fn
_no_quant
(
x
)
x
=
self
.
_activation_fn
(
x
)
return
self
.
_dropout_layer
(
x
)
return
self
.
_dropout_layer
(
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