Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
4d9ed16a
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看板
未验证
提交
4d9ed16a
编写于
4月 02, 2020
作者:
M
MRXLT
提交者:
GitHub
4月 02, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #378 from MRXLT/0.2.0-fix-gpu-v2
bug fix
上级
b721455f
b15d96ab
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
7 addition
and
6 deletion
+7
-6
python/examples/bert/benchmark_batch.py
python/examples/bert/benchmark_batch.py
+2
-4
python/examples/imagenet/image_http_client.py
python/examples/imagenet/image_http_client.py
+4
-1
python/paddle_serving_client/io/__init__.py
python/paddle_serving_client/io/__init__.py
+1
-1
未找到文件。
python/examples/bert/benchmark_batch.py
浏览文件 @
4d9ed16a
...
@@ -53,7 +53,7 @@ def single_func(idx, resource):
...
@@ -53,7 +53,7 @@ def single_func(idx, resource):
feed_batch
.
append
(
reader
.
process
(
dataset
[
bi
]))
feed_batch
.
append
(
reader
.
process
(
dataset
[
bi
]))
b_end
=
time
.
time
()
b_end
=
time
.
time
()
if
profile_flags
:
if
profile_flags
:
print
(
"PROFILE
\t
pid:{}
\t
bert
+
pre_0:{} bert_pre_1:{}"
.
format
(
print
(
"PROFILE
\t
pid:{}
\t
bert
_
pre_0:{} bert_pre_1:{}"
.
format
(
os
.
getpid
(),
os
.
getpid
(),
int
(
round
(
b_start
*
1000000
)),
int
(
round
(
b_start
*
1000000
)),
int
(
round
(
b_end
*
1000000
))))
int
(
round
(
b_end
*
1000000
))))
...
@@ -69,9 +69,7 @@ def single_func(idx, resource):
...
@@ -69,9 +69,7 @@ def single_func(idx, resource):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
multi_thread_runner
=
MultiThreadRunner
()
multi_thread_runner
=
MultiThreadRunner
()
endpoint_list
=
[
endpoint_list
=
[
"127.0.0.1:9292"
]
"127.0.0.1:9292"
,
"127.0.0.1:9293"
,
"127.0.0.1:9294"
,
"127.0.0.1:9295"
]
result
=
multi_thread_runner
.
run
(
single_func
,
args
.
thread
,
result
=
multi_thread_runner
.
run
(
single_func
,
args
.
thread
,
{
"endpoint"
:
endpoint_list
})
{
"endpoint"
:
endpoint_list
})
avg_cost
=
0
avg_cost
=
0
...
...
python/examples/imagenet/image_http_client.py
浏览文件 @
4d9ed16a
...
@@ -30,7 +30,10 @@ def predict(image_path, server):
...
@@ -30,7 +30,10 @@ def predict(image_path, server):
req
=
json
.
dumps
({
"image"
:
image
,
"fetch"
:
[
"score"
]})
req
=
json
.
dumps
({
"image"
:
image
,
"fetch"
:
[
"score"
]})
r
=
requests
.
post
(
r
=
requests
.
post
(
server
,
data
=
req
,
headers
=
{
"Content-Type"
:
"application/json"
})
server
,
data
=
req
,
headers
=
{
"Content-Type"
:
"application/json"
})
try
:
print
(
r
.
json
()[
"score"
][
0
])
print
(
r
.
json
()[
"score"
][
0
])
except
ValueError
:
print
(
r
.
text
)
return
r
return
r
...
...
python/paddle_serving_client/io/__init__.py
浏览文件 @
4d9ed16a
...
@@ -32,7 +32,7 @@ def save_model(server_model_folder,
...
@@ -32,7 +32,7 @@ def save_model(server_model_folder,
executor
=
Executor
(
place
=
CPUPlace
())
executor
=
Executor
(
place
=
CPUPlace
())
feed_var_names
=
[
feed_var_dict
[
x
].
name
for
x
in
feed_var_dict
]
feed_var_names
=
[
feed_var_dict
[
x
].
name
for
x
in
feed_var_dict
]
target_vars
=
fetch_var_dict
.
values
(
)
target_vars
=
list
(
fetch_var_dict
.
values
()
)
save_inference_model
(
save_inference_model
(
server_model_folder
,
server_model_folder
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录