Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiaopch
PaddleRec
提交
2c77c937
P
PaddleRec
项目概览
xiaopch
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2c77c937
编写于
4月 14, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code clean
上级
7f99ff03
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
7 deletion
+8
-7
fleetrec/examples/ctr-dnn_train_single.yaml
fleetrec/examples/ctr-dnn_train_single.yaml
+2
-2
fleetrec/reader/reader.py
fleetrec/reader/reader.py
+2
-1
fleetrec/trainer/factory.py
fleetrec/trainer/factory.py
+4
-4
未找到文件。
fleetrec/examples/ctr-dnn_train_single.yaml
浏览文件 @
2c77c937
...
@@ -31,8 +31,8 @@ train:
...
@@ -31,8 +31,8 @@ train:
reader
:
reader
:
batch_size
:
2
batch_size
:
2
pipe_command
:
"
python
/paddle/eleps/fleetrec/models/ctr_dnn/dataset.py
"
class
:
"
fleetrec.models.ctr_dnn.data_generator
"
train_data_path
:
"
/
paddle/eleps/fleetrec/models/ctr_dnn/data/train
"
train_data_path
:
"
/
root/FleetRec/fleetrec/models/ctr_dnn/data/train/
"
model
:
model
:
models
:
"
fleetrec.models.ctr_dnn.model"
models
:
"
fleetrec.models.ctr_dnn.model"
...
...
fleetrec/reader/reader.py
浏览文件 @
2c77c937
...
@@ -26,7 +26,8 @@ class Reader(dg.MultiSlotDataGenerator):
...
@@ -26,7 +26,8 @@ class Reader(dg.MultiSlotDataGenerator):
__metaclass__
=
abc
.
ABCMeta
__metaclass__
=
abc
.
ABCMeta
def
__init__
(
self
,
config
):
def
__init__
(
self
,
config
):
super
().
__init__
()
dg
.
MultiSlotDataGenerator
.
__init__
(
self
)
if
os
.
path
.
exists
(
config
)
and
os
.
path
.
isfile
(
config
):
if
os
.
path
.
exists
(
config
)
and
os
.
path
.
isfile
(
config
):
with
open
(
config
,
'r'
)
as
rb
:
with
open
(
config
,
'r'
)
as
rb
:
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
...
...
fleetrec/trainer/factory.py
浏览文件 @
2c77c937
...
@@ -30,14 +30,14 @@ class TrainerFactory(object):
...
@@ -30,14 +30,14 @@ class TrainerFactory(object):
pass
pass
@
staticmethod
@
staticmethod
def
_build_trainer
(
config
):
def
_build_trainer
(
config
,
yaml_path
):
print
(
envs
.
pretty_print_envs
(
envs
.
get_global_envs
()))
print
(
envs
.
pretty_print_envs
(
envs
.
get_global_envs
()))
train_mode
=
envs
.
get_global_env
(
"train.trainer"
)
train_mode
=
envs
.
get_global_env
(
"train.trainer"
)
if
train_mode
==
"SingleTraining"
:
if
train_mode
==
"SingleTraining"
:
trainer
=
SingleTrainer
(
config
)
trainer
=
SingleTrainer
(
yaml_path
)
elif
train_mode
==
"ClusterTraining"
:
elif
train_mode
==
"ClusterTraining"
:
trainer
=
ClusterTrainer
(
config
)
trainer
=
ClusterTrainer
(
yaml_path
)
elif
train_mode
==
"CtrTrainer"
:
elif
train_mode
==
"CtrTrainer"
:
trainer
=
CtrPaddleTrainer
(
config
)
trainer
=
CtrPaddleTrainer
(
config
)
else
:
else
:
...
@@ -75,7 +75,7 @@ class TrainerFactory(object):
...
@@ -75,7 +75,7 @@ class TrainerFactory(object):
if
mode
==
"ClusterTraining"
and
container
==
"local"
and
not
instance
:
if
mode
==
"ClusterTraining"
and
container
==
"local"
and
not
instance
:
trainer
=
TrainerFactory
.
_build_engine
(
config
)
trainer
=
TrainerFactory
.
_build_engine
(
config
)
else
:
else
:
trainer
=
TrainerFactory
.
_build_trainer
(
_config
)
trainer
=
TrainerFactory
.
_build_trainer
(
_config
,
config
)
return
trainer
return
trainer
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录