Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
68208bc4
P
PaddleRec
项目概览
PaddlePaddle
/
PaddleRec
通知
68
Star
12
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
27
列表
看板
标记
里程碑
合并请求
10
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
27
Issue
27
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
68208bc4
编写于
6月 10, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix windows adapter
上级
fe6fc5b3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
8 deletion
+12
-8
core/model.py
core/model.py
+2
-2
core/trainer.py
core/trainer.py
+2
-0
core/trainers/framework/network.py
core/trainers/framework/network.py
+8
-6
未找到文件。
core/model.py
浏览文件 @
68208bc4
...
@@ -49,11 +49,11 @@ class ModelBase(object):
...
@@ -49,11 +49,11 @@ class ModelBase(object):
self
.
_slot_inited
=
True
self
.
_slot_inited
=
True
dataset
=
{}
dataset
=
{}
model_dict
=
{}
model_dict
=
{}
for
i
in
envs
.
get_global
_env
(
"phase"
):
for
i
in
self
.
_env
(
"phase"
):
if
i
[
"name"
]
==
kargs
[
"name"
]:
if
i
[
"name"
]
==
kargs
[
"name"
]:
model_dict
=
i
model_dict
=
i
break
break
for
i
in
envs
.
get_global
_env
(
"dataset"
):
for
i
in
self
.
_env
(
"dataset"
):
if
i
[
"name"
]
==
model_dict
[
"dataset_name"
]:
if
i
[
"name"
]
==
model_dict
[
"dataset_name"
]:
dataset
=
i
dataset
=
i
break
break
...
...
core/trainer.py
浏览文件 @
68208bc4
...
@@ -76,6 +76,8 @@ class Trainer(object):
...
@@ -76,6 +76,8 @@ class Trainer(object):
_config
=
envs
.
load_yaml
(
config
)
_config
=
envs
.
load_yaml
(
config
)
self
.
_context
[
"dataset"
]
=
_config
.
get
(
"dataset"
)
phases
=
[]
phases
=
[]
if
phase_names
is
None
:
if
phase_names
is
None
:
phases
=
_config
.
get
(
"phase"
)
phases
=
_config
.
get
(
"phase"
)
...
...
core/trainers/framework/network.py
浏览文件 @
68208bc4
...
@@ -60,8 +60,8 @@ class SingleNetwork(NetworkBase):
...
@@ -60,8 +60,8 @@ class SingleNetwork(NetworkBase):
with
fluid
.
scope_guard
(
scope
):
with
fluid
.
scope_guard
(
scope
):
model_path
=
envs
.
os_path_adapter
(
model_path
=
envs
.
os_path_adapter
(
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
model
=
envs
.
lazy_instance_by_fliename
(
model_path
,
model
=
envs
.
lazy_instance_by_fliename
(
"Model"
)(
None
)
model_path
,
"Model"
)(
context
[
"env"
]
)
if
context
[
"is_infer"
]:
if
context
[
"is_infer"
]:
model
.
_infer_data_var
=
model
.
input_data
(
model
.
_infer_data_var
=
model
.
input_data
(
...
@@ -124,7 +124,8 @@ class PSNetwork(NetworkBase):
...
@@ -124,7 +124,8 @@ class PSNetwork(NetworkBase):
model_path
=
envs
.
os_path_adapter
(
model_path
=
envs
.
os_path_adapter
(
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
model
=
envs
.
lazy_instance_by_fliename
(
model_path
,
"Model"
)(
None
)
model
=
envs
.
lazy_instance_by_fliename
(
model_path
,
"Model"
)(
context
[
"env"
])
model
.
_data_var
=
model
.
input_data
(
model
.
_data_var
=
model
.
input_data
(
dataset_name
=
model_dict
[
"dataset_name"
])
dataset_name
=
model_dict
[
"dataset_name"
])
if
envs
.
get_global_env
(
"dataset."
+
dataset_name
+
if
envs
.
get_global_env
(
"dataset."
+
dataset_name
+
...
@@ -216,8 +217,8 @@ class PslibNetwork(NetworkBase):
...
@@ -216,8 +217,8 @@ class PslibNetwork(NetworkBase):
context
[
"model"
][
model_dict
[
"name"
]]
=
{}
context
[
"model"
][
model_dict
[
"name"
]]
=
{}
model_path
=
envs
.
os_path_adapter
(
model_path
=
envs
.
os_path_adapter
(
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
model
=
envs
.
lazy_instance_by_fliename
(
model_path
,
model
=
envs
.
lazy_instance_by_fliename
(
"Model"
)(
None
)
model_path
,
"Model"
)(
context
[
"env"
]
)
model
.
_data_var
=
model
.
input_data
(
model
.
_data_var
=
model
.
input_data
(
dataset_name
=
model_dict
[
"dataset_name"
])
dataset_name
=
model_dict
[
"dataset_name"
])
if
envs
.
get_global_env
(
"dataset."
+
dataset_name
+
if
envs
.
get_global_env
(
"dataset."
+
dataset_name
+
...
@@ -282,8 +283,9 @@ class CollectiveNetwork(NetworkBase):
...
@@ -282,8 +283,9 @@ class CollectiveNetwork(NetworkBase):
with
fluid
.
scope_guard
(
scope
):
with
fluid
.
scope_guard
(
scope
):
model_path
=
envs
.
os_path_adapter
(
model_path
=
envs
.
os_path_adapter
(
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
envs
.
workspace_adapter
(
model_dict
[
"model"
]))
model
=
envs
.
lazy_instance_by_fliename
(
model_path
,
model
=
envs
.
lazy_instance_by_fliename
(
model_path
,
"Model"
)(
None
)
"Model"
)(
context
[
"env"
]
)
model
.
_data_var
=
model
.
input_data
(
model
.
_data_var
=
model
.
input_data
(
dataset_name
=
model_dict
[
"dataset_name"
])
dataset_name
=
model_dict
[
"dataset_name"
])
if
envs
.
get_global_env
(
"dataset."
+
dataset_name
+
if
envs
.
get_global_env
(
"dataset."
+
dataset_name
+
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录