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
8deba73f
Commit
8deba73f
authored
Apr 06, 2018
by
Zhichao Lu
Committed by
pkulzc
Apr 13, 2018
Browse files
Add classification_loss and localiztion_loss metrics for TPU jobs.
PiperOrigin-RevId: 191957195
parent
aedfa2e4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
research/object_detection/meta_architectures/ssd_meta_arch.py
...arch/object_detection/meta_architectures/ssd_meta_arch.py
+2
-2
research/object_detection/model.py
research/object_detection/model.py
+3
-2
No files found.
research/object_detection/meta_architectures/ssd_meta_arch.py
View file @
8deba73f
...
...
@@ -582,8 +582,8 @@ class SSDMetaArch(model.DetectionModel):
name
=
'classification_loss'
)
loss_dict
=
{
localization_loss
.
op
.
name
:
localization_loss
,
classification_loss
.
op
.
name
:
classification_loss
str
(
localization_loss
.
op
.
name
)
:
localization_loss
,
str
(
classification_loss
.
op
.
name
)
:
classification_loss
}
return
loss_dict
...
...
research/object_detection/model.py
View file @
8deba73f
...
...
@@ -297,8 +297,7 @@ def create_model_fn(detection_model_fn, configs, hparams, use_tpu=False):
regularization_loss
=
tf
.
add_n
(
regularization_losses
,
name
=
'regularization_loss'
)
losses
.
append
(
regularization_loss
)
if
not
use_tpu
:
tf
.
summary
.
scalar
(
'regularization_loss'
,
regularization_loss
)
losses_dict
[
'Loss/regularization_loss'
]
=
regularization_loss
total_loss
=
tf
.
add_n
(
losses
,
name
=
'total_loss'
)
if
mode
==
tf
.
estimator
.
ModeKeys
.
TRAIN
:
...
...
@@ -380,6 +379,8 @@ def create_model_fn(detection_model_fn, configs, hparams, use_tpu=False):
eval_metric_ops
=
eval_util
.
get_eval_metric_ops_for_evaluators
(
eval_metrics
,
category_index
.
values
(),
eval_dict
,
include_metrics_per_category
=
False
)
for
loss_key
,
loss_tensor
in
iter
(
losses_dict
.
items
()):
eval_metric_ops
[
loss_key
]
=
tf
.
metrics
.
mean
(
loss_tensor
)
if
img_summary
is
not
None
:
eval_metric_ops
[
'Detections_Left_Groundtruth_Right'
]
=
(
img_summary
,
tf
.
no_op
())
...
...
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