Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
211f7e38
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看板
提交
211f7e38
编写于
6月 11, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix windows adapter
上级
853cb467
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
7 addition
and
7 deletion
+7
-7
core/trainers/framework/runner.py
core/trainers/framework/runner.py
+3
-3
core/trainers/framework/startup.py
core/trainers/framework/startup.py
+2
-2
models/treebased/tdm/tdm_startup.py
models/treebased/tdm/tdm_startup.py
+2
-2
未找到文件。
core/trainers/framework/runner.py
浏览文件 @
211f7e38
...
@@ -310,7 +310,7 @@ class PSRunner(RunnerBase):
...
@@ -310,7 +310,7 @@ class PSRunner(RunnerBase):
epochs
=
int
(
epochs
=
int
(
envs
.
get_global_env
(
"runner."
+
context
[
"runner_name"
]
+
envs
.
get_global_env
(
"runner."
+
context
[
"runner_name"
]
+
".epochs"
))
".epochs"
))
model_dict
=
context
(
"env"
)
[
"phase"
][
0
]
model_dict
=
context
[
"env"
]
[
"phase"
][
0
]
for
epoch
in
range
(
epochs
):
for
epoch
in
range
(
epochs
):
begin_time
=
time
.
time
()
begin_time
=
time
.
time
()
self
.
_run
(
context
,
model_dict
)
self
.
_run
(
context
,
model_dict
)
...
@@ -337,7 +337,7 @@ class CollectiveRunner(RunnerBase):
...
@@ -337,7 +337,7 @@ class CollectiveRunner(RunnerBase):
epochs
=
int
(
epochs
=
int
(
envs
.
get_global_env
(
"runner."
+
context
[
"runner_name"
]
+
envs
.
get_global_env
(
"runner."
+
context
[
"runner_name"
]
+
".epochs"
))
".epochs"
))
model_dict
=
context
(
"env"
)
[
"phase"
][
0
]
model_dict
=
context
[
"env"
]
[
"phase"
][
0
]
for
epoch
in
range
(
epochs
):
for
epoch
in
range
(
epochs
):
begin_time
=
time
.
time
()
begin_time
=
time
.
time
()
self
.
_run
(
context
,
model_dict
)
self
.
_run
(
context
,
model_dict
)
...
@@ -362,7 +362,7 @@ class PslibRunner(RunnerBase):
...
@@ -362,7 +362,7 @@ class PslibRunner(RunnerBase):
def
run
(
self
,
context
):
def
run
(
self
,
context
):
context
[
"fleet"
].
init_worker
()
context
[
"fleet"
].
init_worker
()
model_dict
=
context
(
"env"
)
[
"phase"
][
0
]
model_dict
=
context
[
"env"
]
[
"phase"
][
0
]
epochs
=
int
(
epochs
=
int
(
envs
.
get_global_env
(
"runner."
+
context
[
"runner_name"
]
+
envs
.
get_global_env
(
"runner."
+
context
[
"runner_name"
]
+
".epochs"
))
".epochs"
))
...
...
core/trainers/framework/startup.py
浏览文件 @
211f7e38
...
@@ -73,7 +73,7 @@ class PSStartup(StartupBase):
...
@@ -73,7 +73,7 @@ class PSStartup(StartupBase):
pass
pass
def
startup
(
self
,
context
):
def
startup
(
self
,
context
):
model_dict
=
context
(
"env"
)
[
"phase"
][
0
]
model_dict
=
context
[
"env"
]
[
"phase"
][
0
]
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
train_prog
=
context
[
"model"
][
model_dict
[
"name"
]][
"main_program"
]
train_prog
=
context
[
"model"
][
model_dict
[
"name"
]][
"main_program"
]
...
@@ -91,7 +91,7 @@ class CollectiveStartup(StartupBase):
...
@@ -91,7 +91,7 @@ class CollectiveStartup(StartupBase):
pass
pass
def
startup
(
self
,
context
):
def
startup
(
self
,
context
):
model_dict
=
context
(
"env"
)
[
"phase"
][
0
]
model_dict
=
context
[
"env"
]
[
"phase"
][
0
]
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
train_prog
=
context
[
"model"
][
model_dict
[
"name"
]][
train_prog
=
context
[
"model"
][
model_dict
[
"name"
]][
"default_main_program"
]
"default_main_program"
]
...
...
models/treebased/tdm/tdm_startup.py
浏览文件 @
211f7e38
...
@@ -47,7 +47,7 @@ class Startup(StartupBase):
...
@@ -47,7 +47,7 @@ class Startup(StartupBase):
def
_single_startup
(
self
,
context
):
def
_single_startup
(
self
,
context
):
load_tree_from_numpy
=
envs
.
get_global_env
(
load_tree_from_numpy
=
envs
.
get_global_env
(
"hyper_parameters.tree.load_tree_from_numpy"
,
False
)
"hyper_parameters.tree.load_tree_from_numpy"
,
False
)
model_dict
=
context
(
"env"
)
[
"phase"
][
0
]
model_dict
=
context
[
"env"
]
[
"phase"
][
0
]
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
context
[
"exe"
].
run
(
context
[
"model"
][
model_dict
[
"name"
]][
context
[
"exe"
].
run
(
context
[
"model"
][
model_dict
[
"name"
]][
"startup_program"
])
"startup_program"
])
...
@@ -106,7 +106,7 @@ class Startup(StartupBase):
...
@@ -106,7 +106,7 @@ class Startup(StartupBase):
warmup_model_path
=
envs
.
get_global_env
(
warmup_model_path
=
envs
.
get_global_env
(
"runner."
+
context
[
"runner_name"
]
+
".init_model_path"
,
None
)
"runner."
+
context
[
"runner_name"
]
+
".init_model_path"
,
None
)
assert
warmup_model_path
!=
None
,
"set runner.init_model_path for loading model"
assert
warmup_model_path
!=
None
,
"set runner.init_model_path for loading model"
model_dict
=
context
(
"env"
)
[
"phase"
][
0
]
model_dict
=
context
[
"env"
]
[
"phase"
][
0
]
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
with
fluid
.
scope_guard
(
context
[
"model"
][
model_dict
[
"name"
]][
"scope"
]):
context
[
"exe"
].
run
(
context
[
"model"
][
model_dict
[
"name"
]][
context
[
"exe"
].
run
(
context
[
"model"
][
model_dict
[
"name"
]][
"startup_program"
])
"startup_program"
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录