Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
a3573c3a
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a3573c3a
编写于
10月 14, 2020
作者:
B
BohaoWu
提交者:
GitHub
10月 14, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into Zelda
上级
0b5a3a74
9b6bad2c
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
16 addition
and
11 deletion
+16
-11
core/general-server/op/general_response_op.cpp
core/general-server/op/general_response_op.cpp
+5
-3
python/paddle_serving_client/__init__.py
python/paddle_serving_client/__init__.py
+9
-7
python/paddle_serving_client/io/__init__.py
python/paddle_serving_client/io/__init__.py
+2
-1
未找到文件。
core/general-server/op/general_response_op.cpp
浏览文件 @
a3573c3a
...
@@ -155,11 +155,13 @@ int GeneralResponseOp::inference() {
...
@@ -155,11 +155,13 @@ int GeneralResponseOp::inference() {
}
}
if
(
model_config
->
_is_lod_fetch
[
idx
])
{
if
(
model_config
->
_is_lod_fetch
[
idx
])
{
if
(
in
->
at
(
idx
).
lod
.
size
()
>
0
)
{
for
(
int
j
=
0
;
j
<
in
->
at
(
idx
).
lod
[
0
].
size
();
++
j
)
{
for
(
int
j
=
0
;
j
<
in
->
at
(
idx
).
lod
[
0
].
size
();
++
j
)
{
fetch_p
->
mutable_tensor_array
(
var_idx
)
->
add_lod
(
fetch_p
->
mutable_tensor_array
(
var_idx
)
->
add_lod
(
in
->
at
(
idx
).
lod
[
0
][
j
]);
in
->
at
(
idx
).
lod
[
0
][
j
]);
}
}
}
}
}
VLOG
(
2
)
<<
"(logid="
<<
log_id
<<
") fetch var ["
VLOG
(
2
)
<<
"(logid="
<<
log_id
<<
") fetch var ["
<<
model_config
->
_fetch_name
[
idx
]
<<
"] ready"
;
<<
model_config
->
_fetch_name
[
idx
]
<<
"] ready"
;
...
...
python/paddle_serving_client/__init__.py
浏览文件 @
a3573c3a
...
@@ -354,8 +354,9 @@ class Client(object):
...
@@ -354,8 +354,9 @@ class Client(object):
name
))
name
))
result_map
[
name
].
shape
=
shape
result_map
[
name
].
shape
=
shape
if
name
in
self
.
lod_tensor_set
:
if
name
in
self
.
lod_tensor_set
:
result_map
[
"{}.lod"
.
format
(
tmp_lod
=
result_batch_handle
.
get_lod
(
mi
,
name
)
name
)]
=
result_batch_handle
.
get_lod
(
mi
,
name
)
if
np
.
size
(
tmp_lod
)
>
0
:
result_map
[
"{}.lod"
.
format
(
name
)]
=
tmp_lod
elif
self
.
fetch_names_to_type_
[
name
]
==
float32_type
:
elif
self
.
fetch_names_to_type_
[
name
]
==
float32_type
:
result_map
[
name
]
=
result_batch_handle
.
get_float_by_name
(
result_map
[
name
]
=
result_batch_handle
.
get_float_by_name
(
mi
,
name
)
mi
,
name
)
...
@@ -367,9 +368,9 @@ class Client(object):
...
@@ -367,9 +368,9 @@ class Client(object):
shape
=
result_batch_handle
.
get_shape
(
mi
,
name
)
shape
=
result_batch_handle
.
get_shape
(
mi
,
name
)
result_map
[
name
].
shape
=
shape
result_map
[
name
].
shape
=
shape
if
name
in
self
.
lod_tensor_set
:
if
name
in
self
.
lod_tensor_set
:
result_map
[
"{}.lod"
.
format
(
tmp_lod
=
result_batch_handle
.
get_lod
(
mi
,
name
)
name
)]
=
result_batch_handle
.
get_lod
(
mi
,
name
)
if
np
.
size
(
tmp_lod
)
>
0
:
result_map
[
"{}.lod"
.
format
(
name
)]
=
tmp_lod
elif
self
.
fetch_names_to_type_
[
name
]
==
int32_type
:
elif
self
.
fetch_names_to_type_
[
name
]
==
int32_type
:
# result_map[name] will be py::array(numpy array)
# result_map[name] will be py::array(numpy array)
result_map
[
name
]
=
result_batch_handle
.
get_int32_by_name
(
result_map
[
name
]
=
result_batch_handle
.
get_int32_by_name
(
...
@@ -382,8 +383,9 @@ class Client(object):
...
@@ -382,8 +383,9 @@ class Client(object):
shape
=
result_batch_handle
.
get_shape
(
mi
,
name
)
shape
=
result_batch_handle
.
get_shape
(
mi
,
name
)
result_map
[
name
].
shape
=
shape
result_map
[
name
].
shape
=
shape
if
name
in
self
.
lod_tensor_set
:
if
name
in
self
.
lod_tensor_set
:
result_map
[
"{}.lod"
.
format
(
tmp_lod
=
result_batch_handle
.
get_lod
(
mi
,
name
)
name
)]
=
result_batch_handle
.
get_lod
(
mi
,
name
)
if
np
.
size
(
tmp_lod
)
>
0
:
result_map
[
"{}.lod"
.
format
(
name
)]
=
tmp_lod
multi_result_map
.
append
(
result_map
)
multi_result_map
.
append
(
result_map
)
ret
=
None
ret
=
None
if
len
(
model_engine_names
)
==
1
:
if
len
(
model_engine_names
)
==
1
:
...
...
python/paddle_serving_client/io/__init__.py
浏览文件 @
a3573c3a
...
@@ -74,7 +74,8 @@ def save_model(server_model_folder,
...
@@ -74,7 +74,8 @@ def save_model(server_model_folder,
fetch_var
=
model_conf
.
FetchVar
()
fetch_var
=
model_conf
.
FetchVar
()
fetch_var
.
alias_name
=
key
fetch_var
.
alias_name
=
key
fetch_var
.
name
=
fetch_var_dict
[
key
].
name
fetch_var
.
name
=
fetch_var_dict
[
key
].
name
fetch_var
.
is_lod_tensor
=
fetch_var_dict
[
key
].
lod_level
>=
1
#fetch_var.is_lod_tensor = fetch_var_dict[key].lod_level >= 1
fetch_var
.
is_lod_tensor
=
1
if
fetch_var_dict
[
key
].
dtype
==
core
.
VarDesc
.
VarType
.
INT64
:
if
fetch_var_dict
[
key
].
dtype
==
core
.
VarDesc
.
VarType
.
INT64
:
fetch_var
.
fetch_type
=
0
fetch_var
.
fetch_type
=
0
if
fetch_var_dict
[
key
].
dtype
==
core
.
VarDesc
.
VarType
.
FP32
:
if
fetch_var_dict
[
key
].
dtype
==
core
.
VarDesc
.
VarType
.
FP32
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录