Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
曾经的那一瞬间
Models
提交
df7e66d2
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,发现更多精彩内容 >>
未验证
提交
df7e66d2
编写于
7月 28, 2020
作者:
S
Srihari Humbarwadi
提交者:
GitHub
7月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed typos in doc strings and variable naming
上级
07484704
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
6 deletion
+7
-6
official/modeling/training/distributed_executor.py
official/modeling/training/distributed_executor.py
+7
-6
未找到文件。
official/modeling/training/distributed_executor.py
浏览文件 @
df7e66d2
...
...
@@ -63,8 +63,8 @@ def metrics_as_dict(metric):
"""Puts input metric(s) into a list.
Args:
metric: metric(s) to be put into the list. `metric` could be a object, a
list or a dict of tf.keras.metrics.Metric or has the `required_method`.
metric: metric(s) to be put into the list. `metric` could be a
n
object, a
list
,
or a dict of tf.keras.metrics.Metric or has the `required_method`.
Returns:
A dictionary of valid metrics.
...
...
@@ -351,7 +351,8 @@ class DistributedExecutor(object):
train_input_fn: (params: dict) -> tf.data.Dataset training data input
function.
eval_input_fn: (Optional) same type as train_input_fn. If not None, will
trigger evaluting metric on eval data. If None, will not run eval step.
trigger evaluating metric on eval data. If None, will not run the eval
step.
model_dir: the folder path for model checkpoints.
total_steps: total training steps.
iterations_per_loop: train steps per loop. After each loop, this job will
...
...
@@ -672,7 +673,7 @@ class DistributedExecutor(object):
raise
ValueError
(
'if `eval_metric_fn` is specified, '
'eval_metric_fn must be a callable.'
)
old_ph
r
ase
=
tf
.
keras
.
backend
.
learning_phase
()
old_phase
=
tf
.
keras
.
backend
.
learning_phase
()
tf
.
keras
.
backend
.
set_learning_phase
(
0
)
params
=
self
.
_params
strategy
=
self
.
_strategy
...
...
@@ -709,7 +710,7 @@ class DistributedExecutor(object):
summary_writer
(
metrics
=
eval_metric_result
,
step
=
current_step
)
reset_states
(
eval_metric
)
tf
.
keras
.
backend
.
set_learning_phase
(
old_ph
r
ase
)
tf
.
keras
.
backend
.
set_learning_phase
(
old_phase
)
return
eval_metric_result
,
current_step
def
predict
(
self
):
...
...
@@ -759,7 +760,7 @@ class ExecutorBuilder(object):
Args:
strategy_type: string. One of 'tpu', 'mirrored', 'multi_worker_mirrored'.
If None
. U
ser is responsible to set the strategy before calling
If None
, the u
ser is responsible to set the strategy before calling
build_executor(...).
strategy_config: necessary config for constructing the proper Strategy.
Check strategy_flags_dict() for examples of the structure.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录