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
14c32065
Commit
14c32065
authored
Apr 22, 2022
by
A. Unique TensorFlower
Browse files
Freeze backbone support for RetinaNet
PiperOrigin-RevId: 443733011
parent
e9dbffec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
official/vision/configs/retinanet.py
official/vision/configs/retinanet.py
+4
-0
official/vision/tasks/retinanet.py
official/vision/tasks/retinanet.py
+4
-0
No files found.
official/vision/configs/retinanet.py
View file @
14c32065
...
@@ -167,6 +167,10 @@ class RetinaNetTask(cfg.TaskConfig):
...
@@ -167,6 +167,10 @@ class RetinaNetTask(cfg.TaskConfig):
# If set, the Waymo Open Dataset evaluator would be used.
# If set, the Waymo Open Dataset evaluator would be used.
use_wod_metrics
:
bool
=
False
use_wod_metrics
:
bool
=
False
# If set, freezes the backbone during training.
# TODO(crisnv) Add paper link when available.
freeze_backbone
:
bool
=
False
@
exp_factory
.
register_config_factory
(
'retinanet'
)
@
exp_factory
.
register_config_factory
(
'retinanet'
)
def
retinanet
()
->
cfg
.
ExperimentConfig
:
def
retinanet
()
->
cfg
.
ExperimentConfig
:
...
...
official/vision/tasks/retinanet.py
View file @
14c32065
...
@@ -59,6 +59,10 @@ class RetinaNetTask(base_task.Task):
...
@@ -59,6 +59,10 @@ class RetinaNetTask(base_task.Task):
input_specs
=
input_specs
,
input_specs
=
input_specs
,
model_config
=
self
.
task_config
.
model
,
model_config
=
self
.
task_config
.
model
,
l2_regularizer
=
l2_regularizer
)
l2_regularizer
=
l2_regularizer
)
if
self
.
task_config
.
freeze_backbone
:
model
.
backbone
.
trainable
=
False
return
model
return
model
def
initialize
(
self
,
model
:
tf
.
keras
.
Model
):
def
initialize
(
self
,
model
:
tf
.
keras
.
Model
):
...
...
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