Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
曾经的那一瞬间
Models
提交
1af7172d
M
Models
项目概览
曾经的那一瞬间
/
Models
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1af7172d
编写于
1月 27, 2020
作者:
Y
Yanhui Liang
提交者:
A. Unique TensorFlower
1月 27, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove 'num_workers' arg from get_distribution_strategy() method.
PiperOrigin-RevId: 291810091
上级
569ec532
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
5 addition
and
12 deletion
+5
-12
official/modeling/training/distributed_executor.py
official/modeling/training/distributed_executor.py
+1
-2
official/r1/resnet/resnet_run_loop.py
official/r1/resnet/resnet_run_loop.py
+0
-1
official/utils/misc/distribution_utils.py
official/utils/misc/distribution_utils.py
+2
-4
official/vision/image_classification/resnet_cifar_main.py
official/vision/image_classification/resnet_cifar_main.py
+0
-1
official/vision/image_classification/resnet_ctl_imagenet_main.py
...l/vision/image_classification/resnet_ctl_imagenet_main.py
+0
-1
official/vision/image_classification/resnet_imagenet_main.py
official/vision/image_classification/resnet_imagenet_main.py
+2
-3
未找到文件。
official/modeling/training/distributed_executor.py
浏览文件 @
1af7172d
...
...
@@ -673,12 +673,11 @@ class ExecutorBuilder(object):
"""
def
__init__
(
self
,
strategy_type
=
None
,
strategy_config
=
None
):
num_workers
=
distribution_utils
.
configure_cluster
(
_
=
distribution_utils
.
configure_cluster
(
strategy_config
.
worker_hosts
,
strategy_config
.
task_index
)
self
.
_strategy
=
distribution_utils
.
get_distribution_strategy
(
distribution_strategy
=
strategy_type
,
num_gpus
=
strategy_config
.
num_gpus
,
num_workers
=
num_workers
,
all_reduce_alg
=
strategy_config
.
all_reduce_alg
,
num_packs
=
strategy_config
.
num_packs
,
tpu_address
=
strategy_config
.
tpu
)
...
...
official/r1/resnet/resnet_run_loop.py
浏览文件 @
1af7172d
...
...
@@ -563,7 +563,6 @@ def resnet_main(
distribution_strategy
=
distribution_utils
.
get_distribution_strategy
(
distribution_strategy
=
flags_obj
.
distribution_strategy
,
num_gpus
=
flags_core
.
get_num_gpus
(
flags_obj
),
num_workers
=
num_workers
,
all_reduce_alg
=
flags_obj
.
all_reduce_alg
,
num_packs
=
flags_obj
.
num_packs
)
...
...
official/utils/misc/distribution_utils.py
浏览文件 @
1af7172d
...
...
@@ -83,7 +83,6 @@ def _mirrored_cross_device_ops(all_reduce_alg, num_packs):
def
get_distribution_strategy
(
distribution_strategy
=
"mirrored"
,
num_gpus
=
0
,
num_workers
=
1
,
all_reduce_alg
=
None
,
num_packs
=
1
,
tpu_address
=
None
):
...
...
@@ -96,7 +95,6 @@ def get_distribution_strategy(distribution_strategy="mirrored",
'off' means not to use Distribution Strategy; 'tpu' means to use
TPUStrategy using `tpu_address`.
num_gpus: Number of GPUs to run this model.
num_workers: Number of workers to run this model.
all_reduce_alg: Optional. Specifies which algorithm to use when performing
all-reduce. For `MirroredStrategy`, valid values are "nccl" and
"hierarchical_copy". For `MultiWorkerMirroredStrategy`, valid values are
...
...
@@ -120,8 +118,8 @@ def get_distribution_strategy(distribution_strategy="mirrored",
if
distribution_strategy
==
"off"
:
if
num_gpus
>
1
:
raise
ValueError
(
"When {} GPUs a
nd {} workers a
re specified, distribution_strategy "
"flag cannot be set to 'off'."
.
format
(
num_gpus
,
num_workers
))
"When {} GPUs are specified, distribution_strategy "
"flag cannot be set to 'off'."
.
format
(
num_gpus
))
return
None
if
distribution_strategy
==
"tpu"
:
...
...
official/vision/image_classification/resnet_cifar_main.py
浏览文件 @
1af7172d
...
...
@@ -104,7 +104,6 @@ def run(flags_obj):
strategy
=
distribution_utils
.
get_distribution_strategy
(
distribution_strategy
=
flags_obj
.
distribution_strategy
,
num_gpus
=
flags_obj
.
num_gpus
,
num_workers
=
distribution_utils
.
configure_cluster
(),
all_reduce_alg
=
flags_obj
.
all_reduce_alg
,
num_packs
=
flags_obj
.
num_packs
)
...
...
official/vision/image_classification/resnet_ctl_imagenet_main.py
浏览文件 @
1af7172d
...
...
@@ -212,7 +212,6 @@ def run(flags_obj):
strategy
=
distribution_utils
.
get_distribution_strategy
(
distribution_strategy
=
flags_obj
.
distribution_strategy
,
num_gpus
=
flags_obj
.
num_gpus
,
num_workers
=
distribution_utils
.
configure_cluster
(),
all_reduce_alg
=
flags_obj
.
all_reduce_alg
,
num_packs
=
flags_obj
.
num_packs
,
tpu_address
=
flags_obj
.
tpu
)
...
...
official/vision/image_classification/resnet_imagenet_main.py
浏览文件 @
1af7172d
...
...
@@ -84,13 +84,12 @@ def run(flags_obj):
tf
.
keras
.
backend
.
set_image_data_format
(
data_format
)
# Configures cluster spec for distribution strategy.
num_workers
=
distribution_utils
.
configure_cluster
(
flags_obj
.
worker_hosts
,
flags_obj
.
task_index
)
_
=
distribution_utils
.
configure_cluster
(
flags_obj
.
worker_hosts
,
flags_obj
.
task_index
)
strategy
=
distribution_utils
.
get_distribution_strategy
(
distribution_strategy
=
flags_obj
.
distribution_strategy
,
num_gpus
=
flags_obj
.
num_gpus
,
num_workers
=
num_workers
,
all_reduce_alg
=
flags_obj
.
all_reduce_alg
,
num_packs
=
flags_obj
.
num_packs
,
tpu_address
=
flags_obj
.
tpu
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录