Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
ff5d824b
S
Serving
项目概览
PaddlePaddle
/
Serving
接近 2 年 前同步成功
通知
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看板
提交
ff5d824b
编写于
5月 09, 2020
作者:
M
MRXLT
提交者:
GitHub
5月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #539 from MRXLT/compatible
improve compatibility
上级
4e971502
83e25682
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
42 addition
and
20 deletion
+42
-20
core/general-client/CMakeLists.txt
core/general-client/CMakeLists.txt
+1
-1
python/examples/imagenet/README.md
python/examples/imagenet/README.md
+7
-0
python/examples/imagenet/README_CN.md
python/examples/imagenet/README_CN.md
+7
-0
python/examples/lac/lac_reader.py
python/examples/lac/lac_reader.py
+4
-2
python/examples/senta/README.md
python/examples/senta/README.md
+6
-0
python/examples/senta/README_CN.md
python/examples/senta/README_CN.md
+5
-0
python/paddle_serving_app/reader/image_reader.py
python/paddle_serving_app/reader/image_reader.py
+1
-1
python/paddle_serving_app/reader/lac_reader.py
python/paddle_serving_app/reader/lac_reader.py
+4
-3
python/paddle_serving_client/__init__.py
python/paddle_serving_client/__init__.py
+0
-11
python/setup.py.client.in
python/setup.py.client.in
+7
-2
未找到文件。
core/general-client/CMakeLists.txt
浏览文件 @
ff5d824b
if
(
CLIENT
)
if
(
CLIENT
)
add_subdirectory
(
pybind11
)
add_subdirectory
(
pybind11
)
pybind11_add_module
(
serving_client src/general_model.cpp src/pybind_general_model.cpp
)
pybind11_add_module
(
serving_client src/general_model.cpp src/pybind_general_model.cpp
)
target_link_libraries
(
serving_client PRIVATE -Wl,--whole-archive utils sdk-cpp pybind python -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl -lz
)
target_link_libraries
(
serving_client PRIVATE -Wl,--whole-archive utils sdk-cpp pybind python -Wl,--no-whole-archive -lpthread -lcrypto -lm -lrt -lssl -ldl -lz
-Wl,-rpath,'$ORIGIN'/lib
)
endif
()
endif
()
python/examples/imagenet/README.md
浏览文件 @
ff5d824b
...
@@ -8,6 +8,13 @@ The example uses the ResNet50_vd model to perform the imagenet 1000 classificati
...
@@ -8,6 +8,13 @@ The example uses the ResNet50_vd model to perform the imagenet 1000 classificati
```
```
sh get_model.sh
sh get_model.sh
```
```
### Install preprocess module
```
pip install paddle_serving_app
```
### HTTP Infer
### HTTP Infer
launch server side
launch server side
...
...
python/examples/imagenet/README_CN.md
浏览文件 @
ff5d824b
...
@@ -8,6 +8,13 @@
...
@@ -8,6 +8,13 @@
```
```
sh get_model.sh
sh get_model.sh
```
```
### 安装数据预处理模块
```
pip install paddle_serving_app
```
### 执行HTTP预测服务
### 执行HTTP预测服务
启动server端
启动server端
...
...
python/examples/lac/lac_reader.py
浏览文件 @
ff5d824b
...
@@ -14,8 +14,10 @@
...
@@ -14,8 +14,10 @@
from
paddle_serving_client
import
Client
from
paddle_serving_client
import
Client
import
sys
import
sys
reload
(
sys
)
py_version
=
sys
.
version_info
[
0
]
sys
.
setdefaultencoding
(
'utf-8'
)
if
py_version
==
2
:
reload
(
sys
)
sys
.
setdefaultencoding
(
'utf-8'
)
import
os
import
os
import
io
import
io
...
...
python/examples/senta/README.md
浏览文件 @
ff5d824b
...
@@ -4,6 +4,12 @@
...
@@ -4,6 +4,12 @@
```
```
sh get_data.sh
sh get_data.sh
```
```
## Install preprocess module
```
pip install paddle_serving_app
```
## Start http service
## Start http service
```
```
python senta_web_service.py senta_bilstm_model/ workdir 9292
python senta_web_service.py senta_bilstm_model/ workdir 9292
...
...
python/examples/senta/README_CN.md
浏览文件 @
ff5d824b
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
```
```
sh get_data.sh
sh get_data.sh
```
```
## 安装数据预处理模块
```
pip install paddle_serving_app
```
## 启动HTTP服务
## 启动HTTP服务
```
```
python senta_web_service.py senta_bilstm_model/ workdir 9292
python senta_web_service.py senta_bilstm_model/ workdir 9292
...
...
python/paddle_serving_app/reader/image_reader.py
浏览文件 @
ff5d824b
...
@@ -16,7 +16,7 @@ import os
...
@@ -16,7 +16,7 @@ import os
import
urllib
import
urllib
import
numpy
as
np
import
numpy
as
np
import
base64
import
base64
import
functional
as
F
from
.
import
functional
as
F
from
PIL
import
Image
,
ImageDraw
from
PIL
import
Image
,
ImageDraw
import
json
import
json
...
...
python/paddle_serving_app/reader/lac_reader.py
浏览文件 @
ff5d824b
...
@@ -12,10 +12,11 @@
...
@@ -12,10 +12,11 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
paddle_serving_client
import
Client
import
sys
import
sys
reload
(
sys
)
py_version
=
sys
.
version_info
[
0
]
sys
.
setdefaultencoding
(
'utf-8'
)
if
py_version
==
2
:
reload
(
sys
)
sys
.
setdefaultencoding
(
'utf-8'
)
import
os
import
os
import
io
import
io
...
...
python/paddle_serving_client/__init__.py
浏览文件 @
ff5d824b
...
@@ -112,7 +112,6 @@ class Client(object):
...
@@ -112,7 +112,6 @@ class Client(object):
self
.
feed_shapes_
=
{}
self
.
feed_shapes_
=
{}
self
.
feed_types_
=
{}
self
.
feed_types_
=
{}
self
.
feed_names_to_idx_
=
{}
self
.
feed_names_to_idx_
=
{}
self
.
rpath
()
self
.
pid
=
os
.
getpid
()
self
.
pid
=
os
.
getpid
()
self
.
predictor_sdk_
=
None
self
.
predictor_sdk_
=
None
self
.
producers
=
[]
self
.
producers
=
[]
...
@@ -121,16 +120,6 @@ class Client(object):
...
@@ -121,16 +120,6 @@ class Client(object):
self
.
all_numpy_input
=
True
self
.
all_numpy_input
=
True
self
.
has_numpy_input
=
False
self
.
has_numpy_input
=
False
def
rpath
(
self
):
lib_path
=
os
.
path
.
dirname
(
paddle_serving_client
.
__file__
)
client_path
=
os
.
path
.
join
(
lib_path
,
'serving_client.so'
)
lib_path
=
os
.
path
.
join
(
lib_path
,
'lib'
)
ld_path
=
os
.
getenv
(
'LD_LIBRARY_PATH'
)
if
ld_path
==
None
:
os
.
environ
[
'LD_LIBRARY_PATH'
]
=
lib_path
elif
ld_path
not
in
lib_path
:
os
.
environ
[
'LD_LIBRARY_PATH'
]
=
ld_path
+
':'
+
lib_path
def
load_client_config
(
self
,
path
):
def
load_client_config
(
self
,
path
):
from
.serving_client
import
PredictorClient
from
.serving_client
import
PredictorClient
from
.serving_client
import
PredictorRes
from
.serving_client
import
PredictorRes
...
...
python/setup.py.client.in
浏览文件 @
ff5d824b
...
@@ -26,7 +26,7 @@ from setuptools import setup
...
@@ -26,7 +26,7 @@ from setuptools import setup
from paddle_serving_client.version import serving_client_version
from paddle_serving_client.version import serving_client_version
from pkg_resources import DistributionNotFound, get_distribution
from pkg_resources import DistributionNotFound, get_distribution
py_version = sys.version_info
[0]
py_version = sys.version_info
def python_version():
def python_version():
return [int(v) for v in platform.python_version().split(".")]
return [int(v) for v in platform.python_version().split(".")]
...
@@ -39,7 +39,12 @@ def find_package(pkgname):
...
@@ -39,7 +39,12 @@ def find_package(pkgname):
return False
return False
def copy_lib():
def copy_lib():
lib_list = ['libpython2.7.so.1.0', 'libssl.so.10', 'libcrypto.so.10'] if py_version == 2 else ['libpython3.6m.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
if py_version[0] == 2:
lib_list = ['libpython2.7.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
elif py_version[1] == 6:
lib_list = ['libpython3.6m.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
elif py_version[1] == 7:
lib_list = ['libpython3.7m.so.1.0', 'libssl.so.10', 'libcrypto.so.10']
os.popen('mkdir -p paddle_serving_client/lib')
os.popen('mkdir -p paddle_serving_client/lib')
for lib in lib_list:
for lib in lib_list:
r = os.popen('whereis {}'.format(lib))
r = os.popen('whereis {}'.format(lib))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录