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
OpenDAS
apex
Commits
cb6d8f1a
Commit
cb6d8f1a
authored
Sep 06, 2018
by
Michael Carilli
Browse files
Enabling single-process fallback for examples/imagenet/main_reducer.py
parent
a2801d91
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
examples/imagenet/main_reducer.py
examples/imagenet/main_reducer.py
+4
-2
No files found.
examples/imagenet/main_reducer.py
View file @
cb6d8f1a
...
...
@@ -307,6 +307,7 @@ def train(train_loader, model, criterion, optimizer, epoch):
if
args
.
fp16
:
model
.
zero_grad
()
loss
.
backward
()
if
args
.
distributed
:
reducer
.
reduce
()
model_grads_to_master_grads
(
model_params
,
master_params
)
if
args
.
static_loss_scale
!=
1
:
...
...
@@ -317,6 +318,7 @@ def train(train_loader, model, criterion, optimizer, epoch):
else
:
optimizer
.
zero_grad
()
loss
.
backward
()
if
args
.
distributed
:
reducer
.
reduce
()
optimizer
.
step
()
...
...
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