Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
4228ed67
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看板
提交
4228ed67
编写于
9月 23, 2019
作者:
L
linan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update log
Change-Id: I0f930d495ad2aa917faf43f58200db2f9823ea6d
上级
b21b50b2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
4 deletion
+4
-4
paddle/fluid/train/custom_trainer/feed/process/learner_process.cc
...luid/train/custom_trainer/feed/process/learner_process.cc
+4
-4
未找到文件。
paddle/fluid/train/custom_trainer/feed/process/learner_process.cc
浏览文件 @
4228ed67
...
@@ -98,14 +98,14 @@ int LearnerProcess::wait_save_model(uint64_t epoch_id, ModelSaveWay way, bool is
...
@@ -98,14 +98,14 @@ int LearnerProcess::wait_save_model(uint64_t epoch_id, ModelSaveWay way, bool is
table_set
.
insert
(
itr
.
first
);
table_set
.
insert
(
itr
.
first
);
}
}
auto
save_path
=
fs
->
path_join
(
model_dir
,
executor
->
train_exe_name
()
+
"_param"
);
auto
save_path
=
fs
->
path_join
(
model_dir
,
executor
->
train_exe_name
()
+
"_param"
);
VLOG
(
2
)
<<
"Start save model, save_path:"
<<
save_path
;
ENVLOG_WORKER_MASTER_NOTICE
(
"Start save model, save_path: %s"
,
save_path
.
c_str
())
;
executor
->
save_persistables
(
save_path
);
executor
->
save_persistables
(
save_path
);
}
}
int
ret_size
=
0
;
int
ret_size
=
0
;
auto
table_num
=
table_set
.
size
();
auto
table_num
=
table_set
.
size
();
std
::
future
<
int
>
rets
[
table_num
];
std
::
future
<
int
>
rets
[
table_num
];
for
(
auto
table_id
:
table_set
)
{
for
(
auto
table_id
:
table_set
)
{
VLOG
(
2
)
<<
"Start save model, table_id:"
<<
table_id
;
ENVLOG_WORKER_MASTER_NOTICE
(
"Start save model, table_id: %d"
,
table_id
)
;
rets
[
ret_size
++
]
=
ps_client
->
save
(
table_id
,
model_dir
,
std
::
to_string
((
int
)
way
));
rets
[
ret_size
++
]
=
ps_client
->
save
(
table_id
,
model_dir
,
std
::
to_string
((
int
)
way
));
}
}
int
all_ret
=
0
;
int
all_ret
=
0
;
...
@@ -114,7 +114,7 @@ int LearnerProcess::wait_save_model(uint64_t epoch_id, ModelSaveWay way, bool is
...
@@ -114,7 +114,7 @@ int LearnerProcess::wait_save_model(uint64_t epoch_id, ModelSaveWay way, bool is
all_ret
|=
rets
[
i
].
get
();
all_ret
|=
rets
[
i
].
get
();
}
}
timer
.
Pause
();
timer
.
Pause
();
VLOG
(
2
)
<<
"Save Model Cost(s):"
<<
timer
.
ElapsedSec
(
);
ENVLOG_WORKER_MASTER_NOTICE
(
"Save Model Cost(s): %f"
,
timer
.
ElapsedSec
()
);
// save cache model, 只有inference需要cache_model
// save cache model, 只有inference需要cache_model
auto
*
ps_param
=
_context_ptr
->
pslib
->
get_param
();
auto
*
ps_param
=
_context_ptr
->
pslib
->
get_param
();
...
@@ -173,7 +173,7 @@ int LearnerProcess::load_model(uint64_t epoch_id) {
...
@@ -173,7 +173,7 @@ int LearnerProcess::load_model(uint64_t epoch_id) {
auto
scope
=
std
::
move
(
executor
->
fetch_scope
());
auto
scope
=
std
::
move
(
executor
->
fetch_scope
());
CHECK
(
itr
.
second
[
0
]
->
create
(
scope
.
get
())
==
0
);
CHECK
(
itr
.
second
[
0
]
->
create
(
scope
.
get
())
==
0
);
}
else
{
}
else
{
ENVLOG_WORKER_MASTER_NOTICE
(
"Loading model %s"
,
model_dir
.
c_str
());
ENVLOG_WORKER_MASTER_NOTICE
(
"Loading model %s"
,
table_model_path
.
c_str
());
auto
status
=
_context_ptr
->
ps_client
()
->
load
(
itr
.
first
,
auto
status
=
_context_ptr
->
ps_client
()
->
load
(
itr
.
first
,
model_dir
,
std
::
to_string
((
int
)
ModelSaveWay
::
ModelSaveTrainCheckpoint
));
model_dir
,
std
::
to_string
((
int
)
ModelSaveWay
::
ModelSaveTrainCheckpoint
));
CHECK
(
status
.
get
()
==
0
)
<<
"table load failed, id:"
<<
itr
.
first
;
CHECK
(
status
.
get
()
==
0
)
<<
"table load failed, id:"
<<
itr
.
first
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录