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
6cfa81a1
"vscode:/vscode.git/clone" did not exist on "7919149a1e85773d9767373dbe0867ea9a67c917"
Commit
6cfa81a1
authored
Jun 04, 2019
by
guptapriya
Browse files
Remove metrics hack for dist strat
parent
51289259
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
official/transformer/v2/metrics.py
official/transformer/v2/metrics.py
+3
-7
No files found.
official/transformer/v2/metrics.py
View file @
6cfa81a1
...
@@ -160,10 +160,6 @@ class MetricLayer(tf.keras.layers.Layer):
...
@@ -160,10 +160,6 @@ class MetricLayer(tf.keras.layers.Layer):
def
call
(
self
,
inputs
):
def
call
(
self
,
inputs
):
logits
,
targets
=
inputs
[
0
],
inputs
[
1
]
logits
,
targets
=
inputs
[
0
],
inputs
[
1
]
# TODO(guptapriya): Remove this check when underlying issue to create
# metrics with dist strat in cross replica context is fixed.
if
(
tf
.
distribute
.
has_strategy
()
and
not
tf
.
distribute
.
in_cross_replica_context
()):
for
mean
,
fn
in
self
.
metric_mean_fns
:
for
mean
,
fn
in
self
.
metric_mean_fns
:
m
=
mean
(
*
fn
(
logits
,
targets
))
m
=
mean
(
*
fn
(
logits
,
targets
))
self
.
add_metric
(
m
)
self
.
add_metric
(
m
)
...
...
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