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
d4066f6e
"src/vscode:/vscode.git/clone" did not exist on "98b6bee1a13d225167ef1b8cbab910f8b4f25d3c"
Commit
d4066f6e
authored
May 14, 2018
by
Michael Carilli
Browse files
Manually setting rank in imagenet examples
parent
9661dbd7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
examples/imagenet/main.py
examples/imagenet/main.py
+5
-3
examples/imagenet/main_fp16_optimizer.py
examples/imagenet/main_fp16_optimizer.py
+4
-2
No files found.
examples/imagenet/main.py
View file @
d4066f6e
...
@@ -93,8 +93,10 @@ def main():
...
@@ -93,8 +93,10 @@ def main():
if
args
.
distributed
:
if
args
.
distributed
:
torch
.
cuda
.
set_device
(
args
.
gpu
)
torch
.
cuda
.
set_device
(
args
.
gpu
)
dist
.
init_process_group
(
backend
=
args
.
dist_backend
,
init_method
=
args
.
dist_url
,
dist
.
init_process_group
(
backend
=
args
.
dist_backend
,
world_size
=
args
.
world_size
)
init_method
=
args
.
dist_url
,
world_size
=
args
.
world_size
,
rank
=
args
.
rank
)
if
args
.
fp16
:
if
args
.
fp16
:
assert
torch
.
backends
.
cudnn
.
enabled
,
"fp16 mode requires cudnn backend to be enabled."
assert
torch
.
backends
.
cudnn
.
enabled
,
"fp16 mode requires cudnn backend to be enabled."
...
@@ -152,7 +154,7 @@ def main():
...
@@ -152,7 +154,7 @@ def main():
if
(
args
.
arch
==
"inception_v3"
):
if
(
args
.
arch
==
"inception_v3"
):
crop_size
=
299
crop_size
=
299
val_size
=
320
#
I chose this value a
rbitrarily
, we can
adjust.
val_size
=
320
#
A
rbitrarily
chosen,
adjust
able
.
else
:
else
:
crop_size
=
224
crop_size
=
224
val_size
=
256
val_size
=
256
...
...
examples/imagenet/main_fp16_optimizer.py
View file @
d4066f6e
...
@@ -96,8 +96,10 @@ def main():
...
@@ -96,8 +96,10 @@ def main():
if
args
.
distributed
:
if
args
.
distributed
:
torch
.
cuda
.
set_device
(
args
.
gpu
)
torch
.
cuda
.
set_device
(
args
.
gpu
)
dist
.
init_process_group
(
backend
=
args
.
dist_backend
,
init_method
=
args
.
dist_url
,
dist
.
init_process_group
(
backend
=
args
.
dist_backend
,
world_size
=
args
.
world_size
)
init_method
=
args
.
dist_url
,
world_size
=
args
.
world_size
,
rank
=
args
.
rank
)
if
args
.
fp16
:
if
args
.
fp16
:
assert
torch
.
backends
.
cudnn
.
enabled
,
"fp16 mode requires cudnn backend to be enabled."
assert
torch
.
backends
.
cudnn
.
enabled
,
"fp16 mode requires cudnn backend to be enabled."
...
...
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