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
ceacd37c
Commit
ceacd37c
authored
Aug 17, 2022
by
Jaehong Kim
Committed by
A. Unique TensorFlower
Aug 17, 2022
Browse files
Remove extra fake-quants near by UpSampling2D for the object detection model.
PiperOrigin-RevId: 468273564
parent
3f1ca33a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
official/projects/qat/vision/modeling/factory.py
official/projects/qat/vision/modeling/factory.py
+4
-2
No files found.
official/projects/qat/vision/modeling/factory.py
View file @
ceacd37c
...
...
@@ -130,7 +130,9 @@ def _clone_function_for_fpn(layer):
return
tfmot
.
quantization
.
keras
.
quantize_annotate_layer
(
qat_nn_layers
.
BatchNormalizationWrapper
(
layer
),
qat_configs
.
Default8BitOutputQuantizeConfig
())
return
layer
if
isinstance
(
layer
,
tf
.
keras
.
layers
.
UpSampling2D
):
return
layer
return
tfmot
.
quantization
.
keras
.
quantize_annotate_layer
(
layer
)
def
build_qat_retinanet
(
...
...
@@ -174,7 +176,7 @@ def build_qat_retinanet(
decoder
,
clone_function
=
_clone_function_for_fpn
,
)
decoder
=
tfmot
.
quantization
.
keras
.
quantize_
model
(
decoder
)
decoder
=
tfmot
.
quantization
.
keras
.
quantize_
apply
(
decoder
)
decoder
=
tfmot
.
quantization
.
keras
.
remove_input_range
(
decoder
)
head
=
model
.
head
...
...
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