Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
8ae9094e
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8ae9094e
编写于
1月 04, 2019
作者:
X
Xin Pan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polish and resolve conflicts
test=develop
上级
beaae61a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
6 deletion
+7
-6
paddle/fluid/framework/parallel_executor.cc
paddle/fluid/framework/parallel_executor.cc
+1
-1
python/paddle/fluid/executor.py
python/paddle/fluid/executor.py
+6
-5
未找到文件。
paddle/fluid/framework/parallel_executor.cc
浏览文件 @
8ae9094e
...
@@ -200,7 +200,7 @@ ParallelExecutor::ParallelExecutor(
...
@@ -200,7 +200,7 @@ ParallelExecutor::ParallelExecutor(
member_
->
build_strategy_
=
build_strategy
;
member_
->
build_strategy_
=
build_strategy
;
member_
->
use_all_reduce_
=
member_
->
use_all_reduce_
=
build_strategy
.
reduce_
==
BuildStrategy
::
ReduceStrategy
::
kAllReduce
;
build_strategy
.
reduce_
==
BuildStrategy
::
ReduceStrategy
::
kAllReduce
;
member_
->
nranks_
=
num_trainers
*
places
.
size
();
member_
->
nranks_
=
build_strategy
.
num_trainers_
*
places
.
size
();
if
(
!
member_
->
use_all_reduce_
)
{
if
(
!
member_
->
use_all_reduce_
)
{
PADDLE_ENFORCE
(
places
.
size
()
>
1
,
PADDLE_ENFORCE
(
places
.
size
()
>
1
,
...
...
python/paddle/fluid/executor.py
浏览文件 @
8ae9094e
...
@@ -375,7 +375,6 @@ class Executor(object):
...
@@ -375,7 +375,6 @@ class Executor(object):
self
.
_closed
=
True
self
.
_closed
=
True
def
_run_parallel
(
self
,
def
_run_parallel
(
self
,
exe
,
scope
,
scope
,
feed
=
None
,
feed
=
None
,
fetch_list
=
None
,
fetch_list
=
None
,
...
@@ -391,7 +390,8 @@ class Executor(object):
...
@@ -391,7 +390,8 @@ class Executor(object):
feed_tensor
.
set
(
feed
[
feed_name
],
core
.
CPUPlace
())
feed_tensor
.
set
(
feed
[
feed_name
],
core
.
CPUPlace
())
feed_tensor_dict
[
feed_name
]
=
feed_tensor
feed_tensor_dict
[
feed_name
]
=
feed_tensor
exe
.
feed_and_split_tensor_into_local_scopes
(
feed_tensor_dict
)
self
.
executor
.
feed_and_split_tensor_into_local_scopes
(
feed_tensor_dict
)
elif
isinstance
(
feed
,
list
)
or
isinstance
(
feed
,
tuple
):
elif
isinstance
(
feed
,
list
)
or
isinstance
(
feed
,
tuple
):
if
len
(
feed
)
!=
len
(
self
.
_places
):
if
len
(
feed
)
!=
len
(
self
.
_places
):
raise
ValueError
(
raise
ValueError
(
...
@@ -412,10 +412,10 @@ class Executor(object):
...
@@ -412,10 +412,10 @@ class Executor(object):
tensor
=
tmp
tensor
=
tmp
res_dict
[
feed_name
]
=
tensor
res_dict
[
feed_name
]
=
tensor
res
.
append
(
res_dict
)
res
.
append
(
res_dict
)
exe
.
feed_tensors_into_local_scopes
(
res
)
self
.
executor
.
feed_tensors_into_local_scopes
(
res
)
fetch_var_name
=
'@FETCHED_VAR_NAME@'
fetch_var_name
=
'@FETCHED_VAR_NAME@'
exe
.
run
(
fetch_list
,
fetch_var_name
)
self
.
executor
.
run
(
fetch_list
,
fetch_var_name
)
arr
=
scope
.
find_var
(
fetch_var_name
).
get_lod_tensor_array
()
arr
=
scope
.
find_var
(
fetch_var_name
).
get_lod_tensor_array
()
if
return_numpy
:
if
return_numpy
:
...
@@ -502,12 +502,13 @@ class Executor(object):
...
@@ -502,12 +502,13 @@ class Executor(object):
self
.
executor
=
program
.
_executor
self
.
executor
=
program
.
_executor
if
program
.
_is_data_parallel
:
if
program
.
_is_data_parallel
:
return
self
.
_run_parallel
(
return
self
.
_run_parallel
(
exe
=
program
.
_executor
,
scope
=
scope
,
scope
=
scope
,
feed
=
feed
,
feed
=
feed
,
fetch_list
=
fetch_list
,
fetch_list
=
fetch_list
,
return_numpy
=
return_numpy
)
return_numpy
=
return_numpy
)
else
:
else
:
# TODO(panyx0718): Can compile program to optimize executor
# performance.
return
self
.
_run
(
return
self
.
_run
(
program
.
_program
,
program
.
_program
,
feed
=
feed
,
feed
=
feed
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录