Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
221d977c
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看板
提交
221d977c
编写于
7月 30, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fix
上级
b3ccae27
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
8 deletion
+9
-8
python/examples/imagenet/resnet50_web_service.py
python/examples/imagenet/resnet50_web_service.py
+1
-0
python/paddle_serving_server/web_service.py
python/paddle_serving_server/web_service.py
+2
-2
python/paddle_serving_server_gpu/web_service.py
python/paddle_serving_server_gpu/web_service.py
+6
-6
未找到文件。
python/examples/imagenet/resnet50_web_service.py
浏览文件 @
221d977c
...
...
@@ -54,6 +54,7 @@ class ImageService(WebService):
score_list
=
fetch_map
[
"score"
]
result
=
{
"label"
:
[],
"prob"
:
[]}
for
score
in
score_list
:
score
=
score
.
tolist
()
max_score
=
max
(
score
)
result
[
"label"
].
append
(
self
.
label_dict
[
score
.
index
(
max_score
)]
.
strip
().
replace
(
","
,
""
))
...
...
python/paddle_serving_server/web_service.py
浏览文件 @
221d977c
...
...
@@ -92,8 +92,6 @@ class WebService(object):
if
isinstance
(
feed
,
dict
)
and
"fetch"
in
feed
:
del
feed
[
"fetch"
]
fetch_map
=
self
.
client
.
predict
(
feed
=
feed
,
fetch
=
fetch
)
for
key
in
fetch_map
:
fetch_map
[
key
]
=
fetch_map
[
key
].
tolist
()
result
=
self
.
postprocess
(
feed
=
request
.
json
[
"feed"
],
fetch
=
fetch
,
fetch_map
=
fetch_map
)
result
=
{
"result"
:
result
}
...
...
@@ -137,4 +135,6 @@ class WebService(object):
return
feed
,
fetch
def
postprocess
(
self
,
feed
=
[],
fetch
=
[],
fetch_map
=
None
):
for
key
in
fetch_map
:
fetch_map
[
key
]
=
fetch_map
[
key
].
tolist
()
return
fetch_map
python/paddle_serving_server_gpu/web_service.py
浏览文件 @
221d977c
...
...
@@ -60,8 +60,8 @@ class WebService(object):
server
=
Server
()
server
.
set_op_sequence
(
op_seq_maker
.
get_op_sequence
())
server
.
set_num_threads
(
thread_num
)
server
.
set_mem
_optim
(
mem_optim
)
server
.
set_ir_optim
(
ir_optim
)
server
.
set_mem
ory_optimize
(
mem_optim
)
server
.
set_ir_optim
ize
(
ir_optim
)
server
.
load_model_config
(
self
.
model_config
)
if
gpuid
>=
0
:
...
...
@@ -108,8 +108,8 @@ class WebService(object):
self
.
port_list
[
0
],
-
1
,
thread_num
=
2
,
mem_optim
,
ir_optim
))
mem_optim
=
mem_optim
,
ir_optim
=
ir_optim
))
else
:
for
i
,
gpuid
in
enumerate
(
self
.
gpus
):
self
.
rpc_service_list
.
append
(
...
...
@@ -118,8 +118,8 @@ class WebService(object):
self
.
port_list
[
i
],
gpuid
,
thread_num
=
2
,
mem_optim
,
ir_optim
))
mem_optim
=
mem_optim
,
ir_optim
=
ir_optim
))
def
_launch_web_service
(
self
):
gpu_num
=
len
(
self
.
gpus
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录