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
7dd9852e
Commit
7dd9852e
authored
May 13, 2022
by
Jinoo Baek
Committed by
A. Unique TensorFlower
May 13, 2022
Browse files
Indentation bug. Divide by num_replicas_in_sync once.
PiperOrigin-RevId: 448508763
parent
f7201d1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
official/modeling/multitask/multitask.py
official/modeling/multitask/multitask.py
+4
-4
No files found.
official/modeling/multitask/multitask.py
View file @
7dd9852e
...
...
@@ -138,10 +138,10 @@ class MultiTask(tf.Module, metaclass=abc.ABCMeta):
self
.
tasks
[
name
].
process_metrics
(
task_metrics
[
name
],
labels
,
outputs
,
**
kwargs
)
# Scales loss as the default gradients allreduce performs sum inside
# the optimizer.
scaled_loss
=
total_loss
/
tf
.
distribute
.
get_strategy
(
).
num_replicas_in_sync
# Scales loss as the default gradients allreduce performs sum inside
# the optimizer.
scaled_loss
=
total_loss
/
tf
.
distribute
.
get_strategy
(
).
num_replicas_in_sync
tvars
=
multi_task_model
.
trainable_variables
grads
=
tape
.
gradient
(
scaled_loss
,
tvars
)
optimizer
.
apply_gradients
(
list
(
zip
(
grads
,
tvars
)))
...
...
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