Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
7a7843c7
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看板
提交
7a7843c7
编写于
5月 14, 2020
作者:
C
chengmo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add evaluate only choice
上级
9b961565
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
4 deletion
+22
-4
core/trainers/single_trainer.py
core/trainers/single_trainer.py
+6
-1
core/trainers/transpiler_trainer.py
core/trainers/transpiler_trainer.py
+11
-2
models/recall/word2vec/config.yaml
models/recall/word2vec/config.yaml
+5
-1
未找到文件。
core/trainers/single_trainer.py
浏览文件 @
7a7843c7
...
@@ -55,7 +55,12 @@ class SingleTrainer(TranspileTrainer):
...
@@ -55,7 +55,12 @@ class SingleTrainer(TranspileTrainer):
if
metrics
:
if
metrics
:
self
.
fetch_vars
=
metrics
.
values
()
self
.
fetch_vars
=
metrics
.
values
()
self
.
fetch_alias
=
metrics
.
keys
()
self
.
fetch_alias
=
metrics
.
keys
()
context
[
'status'
]
=
'startup_pass'
evaluate_only
=
envs
.
get_global_env
(
'evaluate_only'
,
False
,
namespace
=
'evaluate'
)
if
evaluate_only
:
context
[
'status'
]
=
'infer_pass'
else
:
context
[
'status'
]
=
'startup_pass'
def
startup
(
self
,
context
):
def
startup
(
self
,
context
):
self
.
_exe
.
run
(
fluid
.
default_startup_program
())
self
.
_exe
.
run
(
fluid
.
default_startup_program
())
...
...
core/trainers/transpiler_trainer.py
浏览文件 @
7a7843c7
...
@@ -229,8 +229,17 @@ class TranspileTrainer(Trainer):
...
@@ -229,8 +229,17 @@ class TranspileTrainer(Trainer):
metrics_format
=
", "
.
join
(
metrics_format
)
metrics_format
=
", "
.
join
(
metrics_format
)
self
.
_exe
.
run
(
startup_program
)
self
.
_exe
.
run
(
startup_program
)
for
(
epoch
,
model_dir
)
in
self
.
increment_models
:
model_list
=
self
.
increment_models
print
(
"Begin to infer epoch {}, model_dir: {}"
.
format
(
epoch
,
model_dir
))
evaluate_only
=
envs
.
get_global_env
(
'evaluate_only'
,
False
,
namespace
=
'evaluate'
)
if
evaluate_only
:
model_list
=
[(
0
,
envs
.
get_global_env
(
'evaluate_model_path'
,
""
,
namespace
=
'evaluate'
))]
for
(
epoch
,
model_dir
)
in
model_list
:
print
(
"Begin to infer No.{} model, model_dir: {}"
.
format
(
epoch
,
model_dir
))
program
=
infer_program
.
clone
()
program
=
infer_program
.
clone
()
fluid
.
io
.
load_persistables
(
self
.
_exe
,
model_dir
,
program
)
fluid
.
io
.
load_persistables
(
self
.
_exe
,
model_dir
,
program
)
reader
.
start
()
reader
.
start
()
...
...
models/recall/word2vec/config.yaml
浏览文件 @
7a7843c7
...
@@ -12,7 +12,11 @@
...
@@ -12,7 +12,11 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
evaluate
:
evaluate
:
workspace
:
"
paddlerec.models.recall.word2vec"
workspace
:
"
paddlerec.models.recall.word2vec"
evaluate_only
:
False
evaluate_model_path
:
"
"
reader
:
reader
:
batch_size
:
50
batch_size
:
50
class
:
"
{workspace}/w2v_evaluate_reader.py"
class
:
"
{workspace}/w2v_evaluate_reader.py"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录