Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
e2d2db22
P
PaddleRec
项目概览
BaiXuePrincess
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e2d2db22
编写于
5月 14, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add paddle cloud run
上级
42bdd47e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
3 deletion
+12
-3
core/trainers/cluster_trainer.py
core/trainers/cluster_trainer.py
+9
-0
example/cloud/job.sh
example/cloud/job.sh
+3
-3
未找到文件。
core/trainers/cluster_trainer.py
浏览文件 @
e2d2db22
...
...
@@ -19,6 +19,8 @@ Training use fluid with one node only.
from
__future__
import
print_function
import
os
import
time
import
paddle.fluid
as
fluid
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler
import
fleet
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy
import
StrategyFactory
...
...
@@ -155,14 +157,21 @@ class ClusterTrainer(TranspileTrainer):
fleet
.
init_worker
()
dataset
=
self
.
_get_dataset
()
ins
=
self
.
_get_dataset_ins
()
epochs
=
envs
.
get_global_env
(
"train.epochs"
)
for
i
in
range
(
epochs
):
begin_time
=
time
.
time
()
self
.
_exe
.
train_from_dataset
(
program
=
fluid
.
default_main_program
(),
dataset
=
dataset
,
fetch_list
=
self
.
fetch_vars
,
fetch_info
=
self
.
fetch_alias
,
print_period
=
self
.
fetch_period
)
end_time
=
time
.
time
()
times
=
end_time
-
begin_time
print
(
"epoch {} using time {}, speed {:.2f} lines/s"
.
format
(
i
,
times
,
ins
/
times
))
self
.
save
(
i
,
"train"
,
is_fleet
=
True
)
fleet
.
stop_worker
()
context
[
'status'
]
=
'infer_pass'
...
...
example/cloud/job.sh
浏览文件 @
e2d2db22
...
...
@@ -9,9 +9,9 @@
# ---------------------------------------------------------------------------- #
# variable define #
# ---------------------------------------------------------------------------- #
CPU_NUM
=
16
GLOG_v
=
0
FLAGS_rpc_deadline
=
300000
export
CPU_NUM
=
16
export
GLOG_v
=
0
export
FLAGS_rpc_deadline
=
300000
# ---------------------------------------------------------------------------- #
python
-m
paddlerec.run
-m
paddle_rec_config.yaml
-e
cluster
-r
worker
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录