Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
7e284dca
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看板
未验证
提交
7e284dca
编写于
1月 19, 2021
作者:
J
Jiawei Wang
提交者:
GitHub
1月 19, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #974 from wangjiawei04/v0.4.1
cherry-pick 971 970 967
上级
f388e230
dc5c9786
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
42 addition
and
11 deletion
+42
-11
core/pdcodegen/CMakeLists.txt
core/pdcodegen/CMakeLists.txt
+1
-0
doc/LATEST_PACKAGES.md
doc/LATEST_PACKAGES.md
+6
-2
java/examples/src/main/java/PipelineClientExample.java
java/examples/src/main/java/PipelineClientExample.java
+1
-1
java/examples/src/main/java/StaticPipelineClient.java
java/examples/src/main/java/StaticPipelineClient.java
+1
-1
python/CMakeLists.txt
python/CMakeLists.txt
+9
-1
python/paddle_serving_server/web_service.py
python/paddle_serving_server/web_service.py
+12
-3
python/paddle_serving_server_gpu/__init__.py
python/paddle_serving_server_gpu/__init__.py
+1
-1
python/paddle_serving_server_gpu/web_service.py
python/paddle_serving_server_gpu/web_service.py
+11
-2
未找到文件。
core/pdcodegen/CMakeLists.txt
浏览文件 @
7e284dca
...
@@ -7,6 +7,7 @@ PROTOBUF_GENERATE_CPP(pdcodegen_proto_srcs pdcodegen_proto_hdrs
...
@@ -7,6 +7,7 @@ PROTOBUF_GENERATE_CPP(pdcodegen_proto_srcs pdcodegen_proto_hdrs
LIST
(
APPEND pdcodegen_srcs
${
pdcodegen_proto_srcs
}
)
LIST
(
APPEND pdcodegen_srcs
${
pdcodegen_proto_srcs
}
)
add_executable
(
pdcodegen
${
pdcodegen_srcs
}
)
add_executable
(
pdcodegen
${
pdcodegen_srcs
}
)
add_dependencies
(
pdcodegen boost
)
target_link_libraries
(
pdcodegen protobuf
${
PROTOBUF_PROTOC_LIBRARY
}
)
target_link_libraries
(
pdcodegen protobuf
${
PROTOBUF_PROTOC_LIBRARY
}
)
# install
# install
...
...
doc/LATEST_PACKAGES.md
浏览文件 @
7e284dca
...
@@ -19,7 +19,9 @@ https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post9-p
...
@@ -19,7 +19,9 @@ https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post9-p
#cuda 10.0
#cuda 10.0
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post10-py3-none-any.whl
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post10-py3-none-any.whl
#cuda10.1 with TensorRT 6
#cuda10.1 with TensorRT 6
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.trt-py3-none-any.whl
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post101-py3-none-any.whl
#cuda10.2 with TensorRT 7
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post102-py3-none-any.whl
```
```
### Python 2
### Python 2
```
```
...
@@ -28,7 +30,9 @@ https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post9-p
...
@@ -28,7 +30,9 @@ https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post9-p
#cuda 10.0
#cuda 10.0
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post10-py2-none-any.whl
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post10-py2-none-any.whl
##cuda10.1 with TensorRT 6
##cuda10.1 with TensorRT 6
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.trt-py2-none-any.whl
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post101-py2-none-any.whl
#cuda10.2 with TensorRT 7
https://paddle-serving.bj.bcebos.com/whl/paddle_serving_server_gpu-0.0.0.post102-py2-none-any.whl
```
```
## Client
## Client
...
...
java/examples/src/main/java/PipelineClientExample.java
浏览文件 @
7e284dca
...
@@ -62,7 +62,7 @@ public class PipelineClientExample {
...
@@ -62,7 +62,7 @@ public class PipelineClientExample {
return
false
;
return
false
;
}
}
}
}
PipelineFuture
future
=
StaticPipelineClient
.
client
.
asyn_pr
::
q
edict
(
feed_data
,
fetch
,
false
,
0
);
PipelineFuture
future
=
StaticPipelineClient
.
client
.
asyn_predict
(
feed_data
,
fetch
,
false
,
0
);
HashMap
<
String
,
String
>
result
=
future
.
get
();
HashMap
<
String
,
String
>
result
=
future
.
get
();
if
(
result
==
null
)
{
if
(
result
==
null
)
{
return
false
;
return
false
;
...
...
java/examples/src/main/java/StaticPipelineClient.java
浏览文件 @
7e284dca
...
@@ -37,7 +37,7 @@ public class StaticPipelineClient {
...
@@ -37,7 +37,7 @@ public class StaticPipelineClient {
System
.
out
.
println
(
"already connect."
);
System
.
out
.
println
(
"already connect."
);
return
true
;
return
true
;
}
}
succ
=
clie
i
nt
.
connect
(
target
);
succ
=
client
.
connect
(
target
);
if
(
succ
!=
true
)
{
if
(
succ
!=
true
)
{
System
.
out
.
println
(
"connect failed."
);
System
.
out
.
println
(
"connect failed."
);
return
false
;
return
false
;
...
...
python/CMakeLists.txt
浏览文件 @
7e284dca
...
@@ -81,12 +81,20 @@ if (SERVER)
...
@@ -81,12 +81,20 @@ if (SERVER)
DEPENDS
${
SERVING_SERVER_CORE
}
server_config_py_proto
${
PY_FILES
}
)
DEPENDS
${
SERVING_SERVER_CORE
}
server_config_py_proto
${
PY_FILES
}
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
elseif
(
WITH_TRT
)
elseif
(
WITH_TRT
)
if
(
CUDA_VERSION EQUAL 10.1
)
set
(
SUFFIX 101
)
elseif
(
CUDA_VERSION EQUAL 10.2
)
set
(
SUFFIX 102
)
elseif
(
CUDA_VERSION EQUAL 11.0
)
set
(
SUFFIX 110
)
endif
()
add_custom_command
(
add_custom_command
(
OUTPUT
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
OUTPUT
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
COMMAND cp -r
COMMAND cp -r
${
CMAKE_CURRENT_SOURCE_DIR
}
/paddle_serving_server_gpu/
${
PADDLE_SERVING_BINARY_DIR
}
/python/
${
CMAKE_CURRENT_SOURCE_DIR
}
/paddle_serving_server_gpu/
${
PADDLE_SERVING_BINARY_DIR
}
/python/
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
gen_version.py
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
gen_version.py
"server_gpu"
trt
"server_gpu"
${
SUFFIX
}
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
DEPENDS
${
SERVING_SERVER_CORE
}
server_config_py_proto
${
PY_FILES
}
)
DEPENDS
${
SERVING_SERVER_CORE
}
server_config_py_proto
${
PY_FILES
}
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
add_custom_target
(
paddle_python ALL DEPENDS
${
PADDLE_SERVING_BINARY_DIR
}
/.timestamp
)
...
...
python/paddle_serving_server/web_service.py
浏览文件 @
7e284dca
...
@@ -20,7 +20,7 @@ from paddle_serving_server import OpMaker, OpSeqMaker, Server
...
@@ -20,7 +20,7 @@ from paddle_serving_server import OpMaker, OpSeqMaker, Server
from
paddle_serving_client
import
Client
from
paddle_serving_client
import
Client
from
contextlib
import
closing
from
contextlib
import
closing
import
socket
import
socket
import
numpy
as
np
from
paddle_serving_server
import
pipeline
from
paddle_serving_server
import
pipeline
from
paddle_serving_server.pipeline
import
Op
from
paddle_serving_server.pipeline
import
Op
...
@@ -64,8 +64,8 @@ class WebService(object):
...
@@ -64,8 +64,8 @@ class WebService(object):
f
=
open
(
client_config
,
'r'
)
f
=
open
(
client_config
,
'r'
)
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
str
(
f
.
read
()),
model_conf
)
str
(
f
.
read
()),
model_conf
)
self
.
feed_
names
=
[
var
.
alias_name
for
var
in
model_conf
.
feed_var
]
self
.
feed_
vars
=
{
var
.
name
:
var
for
var
in
model_conf
.
feed_var
}
self
.
fetch_
names
=
[
var
.
alias_name
for
var
in
model_conf
.
fetch_var
]
self
.
fetch_
vars
=
{
var
.
name
:
var
for
var
in
model_conf
.
fetch_var
}
def
_launch_rpc_service
(
self
):
def
_launch_rpc_service
(
self
):
op_maker
=
OpMaker
()
op_maker
=
OpMaker
()
...
@@ -201,6 +201,15 @@ class WebService(object):
...
@@ -201,6 +201,15 @@ class WebService(object):
def
preprocess
(
self
,
feed
=
[],
fetch
=
[]):
def
preprocess
(
self
,
feed
=
[],
fetch
=
[]):
print
(
"This API will be deprecated later. Please do not use it"
)
print
(
"This API will be deprecated later. Please do not use it"
)
is_batch
=
True
is_batch
=
True
feed_dict
=
{}
for
var_name
in
self
.
feed_vars
.
keys
():
feed_dict
[
var_name
]
=
[]
for
feed_ins
in
feed
:
for
key
in
feed_ins
:
feed_dict
[
key
].
append
(
np
.
array
(
feed_ins
[
key
]).
reshape
(
list
(
self
.
feed_vars
[
key
].
shape
))[
np
.
newaxis
,:])
feed
=
{}
for
key
in
feed_dict
:
feed
[
key
]
=
np
.
concatenate
(
feed_dict
[
key
],
axis
=
0
)
return
feed
,
fetch
,
is_batch
return
feed
,
fetch
,
is_batch
def
postprocess
(
self
,
feed
=
[],
fetch
=
[],
fetch_map
=
None
):
def
postprocess
(
self
,
feed
=
[],
fetch
=
[],
fetch_map
=
None
):
...
...
python/paddle_serving_server_gpu/__init__.py
浏览文件 @
7e284dca
...
@@ -423,7 +423,7 @@ class Server(object):
...
@@ -423,7 +423,7 @@ class Server(object):
for
line
in
version_file
.
readlines
():
for
line
in
version_file
.
readlines
():
if
re
.
match
(
"cuda_version"
,
line
):
if
re
.
match
(
"cuda_version"
,
line
):
cuda_version
=
line
.
split
(
"
\"
"
)[
1
]
cuda_version
=
line
.
split
(
"
\"
"
)[
1
]
if
cuda_version
==
"
trt
"
:
if
cuda_version
==
"
101"
or
cuda_version
==
"102"
or
cuda_version
==
"110
"
:
device_version
=
"serving-gpu-"
+
cuda_version
+
"-"
device_version
=
"serving-gpu-"
+
cuda_version
+
"-"
elif
cuda_version
==
"arm"
:
elif
cuda_version
==
"arm"
:
device_version
=
"serving-"
+
cuda_version
+
"-"
device_version
=
"serving-"
+
cuda_version
+
"-"
...
...
python/paddle_serving_server_gpu/web_service.py
浏览文件 @
7e284dca
...
@@ -70,8 +70,8 @@ class WebService(object):
...
@@ -70,8 +70,8 @@ class WebService(object):
f
=
open
(
client_config
,
'r'
)
f
=
open
(
client_config
,
'r'
)
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
model_conf
=
google
.
protobuf
.
text_format
.
Merge
(
str
(
f
.
read
()),
model_conf
)
str
(
f
.
read
()),
model_conf
)
self
.
feed_
names
=
[
var
.
alias_name
for
var
in
model_conf
.
feed_var
]
self
.
feed_
vars
=
{
var
.
name
:
var
for
var
in
model_conf
.
feed_var
}
self
.
fetch_
names
=
[
var
.
alias_name
for
var
in
model_conf
.
fetch_var
]
self
.
fetch_
vars
=
{
var
.
name
:
var
for
var
in
model_conf
.
fetch_var
}
def
set_gpus
(
self
,
gpus
):
def
set_gpus
(
self
,
gpus
):
print
(
"This API will be deprecated later. Please do not use it"
)
print
(
"This API will be deprecated later. Please do not use it"
)
...
@@ -278,6 +278,15 @@ class WebService(object):
...
@@ -278,6 +278,15 @@ class WebService(object):
def
preprocess
(
self
,
feed
=
[],
fetch
=
[]):
def
preprocess
(
self
,
feed
=
[],
fetch
=
[]):
print
(
"This API will be deprecated later. Please do not use it"
)
print
(
"This API will be deprecated later. Please do not use it"
)
is_batch
=
True
is_batch
=
True
feed_dict
=
{}
for
var_name
in
self
.
feed_vars
.
keys
():
feed_dict
[
var_name
]
=
[]
for
feed_ins
in
feed
:
for
key
in
feed_ins
:
feed_dict
[
key
].
append
(
np
.
array
(
feed_ins
[
key
]).
reshape
(
list
(
self
.
feed_vars
[
key
].
shape
))[
np
.
newaxis
,:])
feed
=
{}
for
key
in
feed_dict
:
feed
[
key
]
=
np
.
concatenate
(
feed_dict
[
key
],
axis
=
0
)
return
feed
,
fetch
,
is_batch
return
feed
,
fetch
,
is_batch
def
postprocess
(
self
,
feed
=
[],
fetch
=
[],
fetch_map
=
None
):
def
postprocess
(
self
,
feed
=
[],
fetch
=
[],
fetch_map
=
None
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录