Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
8641aed6
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
1 年多 前同步成功
通知
116
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8641aed6
编写于
6月 15, 2022
作者:
H
HydrogenSulfate
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polish prepare.sh and docs
上级
5609211f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
13 deletion
+40
-13
test_tipc/docs/test_serving_infer_cpp.md
test_tipc/docs/test_serving_infer_cpp.md
+13
-0
test_tipc/docs/test_serving_infer_python.md
test_tipc/docs/test_serving_infer_python.md
+9
-0
test_tipc/prepare.sh
test_tipc/prepare.sh
+0
-11
test_tipc/test_serving_infer_cpp.sh
test_tipc/test_serving_infer_cpp.sh
+9
-1
test_tipc/test_serving_infer_python.sh
test_tipc/test_serving_infer_python.sh
+9
-1
未找到文件。
test_tipc/docs/test_serving_infer_cpp.md
浏览文件 @
8641aed6
...
...
@@ -52,6 +52,19 @@ Linux GPU/CPU C++ 服务化部署测试的主程序为`test_serving_infer_cpp.sh
```
-
安装 PaddleServing 相关组件,包括serving_client、serving-app,自动编译并安装带自定义OP的 serving_server 包,以及自动下载并解压推理模型
```
bash
# 安装必要依赖包
python3.7
-m
pip
install
paddle_serving_client
==
0.9.0
-i
https://pypi.tuna.tsinghua.edu.cn/simple
python3.7
-m
pip
install
paddle-serving-app
==
0.9.0
-i
https://pypi.tuna.tsinghua.edu.cn/simple
# 安装编译自定义OP的serving-server包
pushd
./deploy/paddleserving
source
build_server.sh python3.7
popd
# 测试PP-ShiTu识别模型时需安装faiss包
python3.7-m pip
install
faiss-cpu
==
1.7.1post2
-i
https://pypi.tuna.tsinghua.edu.cn/simple
# 下载模型与数据
bash test_tipc/prepare.sh test_tipc/configs/PPLCNet/PPLCNet_x1_0_linux_gpu_normal_normal_serving_cpp_linux_gpu_cpu.txt serving_infer
```
...
...
test_tipc/docs/test_serving_infer_python.md
浏览文件 @
8641aed6
...
...
@@ -52,6 +52,15 @@ Linux GPU/CPU PYTHON 服务化部署测试的主程序为`test_serving_infer_pyt
```
-
安装 PaddleServing 相关组件,包括serving-server、serving_client、serving-app,自动下载并解压推理模型
```
bash
# 安装必要依赖包
python3.7
-m
pip
install
paddle_serving_client
==
0.9.0
-i
https://pypi.tuna.tsinghua.edu.cn/simple
python3.7
-m
pip
install
paddle-serving-app
==
0.9.0
-i
https://pypi.tuna.tsinghua.edu.cn/simple
python3.7
-m
pip
install install
paddle-serving-server-gpu
==
0.9.0.post101
-i
https://pypi.tuna.tsinghua.edu.cn/simple
# 测试PP-ShiTu识别模型时需安装faiss包
python3.7-m pip
install
faiss-cpu
==
1.7.1post2
-i
https://pypi.tuna.tsinghua.edu.cn/simple
# 下载模型与数据
bash test_tipc/prepare.sh test_tipc/configs/ResNet50/ResNet50_linux_gpu_normal_normal_serving_python_linux_gpu_cpu.txt serving_infer
```
...
...
test_tipc/prepare.sh
浏览文件 @
8641aed6
...
...
@@ -200,18 +200,7 @@ fi
if
[[
${
MODE
}
=
"serving_infer"
]]
;
then
# prepare serving env
python_name
=
$(
func_parser_value
"
${
lines
[2]
}
"
)
${
python_name
}
-m
pip
install
paddle_serving_client
==
0.9.0
-i
https://pypi.tuna.tsinghua.edu.cn/simple
${
python_name
}
-m
pip
install
paddle-serving-app
==
0.9.0
-i
https://pypi.tuna.tsinghua.edu.cn/simple
python_name
=
$(
func_parser_value
"
${
lines
[2]
}
"
)
if
[[
${
FILENAME
}
=
~
"cpp"
]]
;
then
pushd
./deploy/paddleserving
source
build_server.sh
${
python_name
}
popd
else
${
python_name
}
-m
pip
install install
paddle-serving-server-gpu
==
0.9.0.post101
-i
https://pypi.tuna.tsinghua.edu.cn/simple
fi
if
[[
${
model_name
}
=
~
"ShiTu"
]]
;
then
${
python_name
}
-m
pip
install
faiss-cpu
==
1.7.1post2
-i
https://pypi.tuna.tsinghua.edu.cn/simple
cls_inference_model_url
=
$(
func_parser_value
"
${
lines
[3]
}
"
)
cls_tar_name
=
$(
func_get_url_file_name
"
${
cls_inference_model_url
}
"
)
det_inference_model_url
=
$(
func_parser_value
"
${
lines
[4]
}
"
)
...
...
test_tipc/test_serving_infer_cpp.sh
浏览文件 @
8641aed6
...
...
@@ -104,6 +104,8 @@ function func_serving_cls(){
if
[[
${
use_gpu
}
=
"null"
]]
;
then
web_service_cpp_cmd
=
"
${
python_
}
-m paddle_serving_server.serve --model
${
serving_server_dir_name
}
--op GeneralClasOp --port 9292 &"
eval
${
web_service_cpp_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cpp_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
5s
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_cpu_pipeline_batchsize_1.log"
pipeline_cmd
=
"
${
python_
}
test_cpp_serving_client.py >
${
_save_log_path
}
2>&1 "
...
...
@@ -116,6 +118,8 @@ function func_serving_cls(){
else
web_service_cpp_cmd
=
"
${
python_
}
-m paddle_serving_server.serve --model
${
serving_server_dir_name
}
--op GeneralClasOp --port 9292 --gpu_id=
${
use_gpu
}
&"
eval
${
web_service_cpp_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cpp_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
8s
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_gpu_pipeline_batchsize_1.log"
...
...
@@ -213,6 +217,8 @@ function func_serving_rec(){
det_serving_server_dir_name
=
$(
func_get_url_file_name
"
$det_serving_server_value
"
)
web_service_cpp_cmd
=
"
${
python_interp
}
-m paddle_serving_server.serve --model ../../
${
det_serving_server_value
}
../../
${
cls_serving_server_value
}
--op GeneralPicodetOp GeneralFeatureExtractOp --port 9400 &"
eval
${
web_service_cpp_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cpp_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
5s
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_cpu_batchsize_1.log"
pipeline_cmd
=
"
${
python_interp
}
${
pipeline_py
}
>
${
_save_log_path
}
2>&1 "
...
...
@@ -226,6 +232,8 @@ function func_serving_rec(){
det_serving_server_dir_name
=
$(
func_get_url_file_name
"
$det_serving_server_value
"
)
web_service_cpp_cmd
=
"
${
python_interp
}
-m paddle_serving_server.serve --model ../../
${
det_serving_server_value
}
../../
${
cls_serving_server_value
}
--op GeneralPicodetOp GeneralFeatureExtractOp --port 9400 --gpu_id=
${
use_gpu
}
&"
eval
${
web_service_cpp_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cpp_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
5s
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpp_gpu_batchsize_1.log"
pipeline_cmd
=
"
${
python_interp
}
${
pipeline_py
}
>
${
_save_log_path
}
2>&1 "
...
...
@@ -243,7 +251,7 @@ function func_serving_rec(){
# set cuda device
GPUID
=
$2
if
[
${#
GPUID
}
-le
0
]
;
then
env
=
"
"
env
=
"
export CUDA_VISIBLE_DEVICES=0
"
else
env
=
"export CUDA_VISIBLE_DEVICES=
${
GPUID
}
"
fi
...
...
test_tipc/test_serving_infer_python.sh
浏览文件 @
8641aed6
...
...
@@ -98,6 +98,8 @@ function func_serving_cls(){
web_service_cmd
=
"
${
python_
}
${
web_service_py
}
&"
eval
${
web_service_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
5s
for
pipeline
in
${
pipeline_py
[*]
}
;
do
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpu_
${
pipeline
%_client*
}
_batchsize_1.log"
...
...
@@ -130,6 +132,8 @@ function func_serving_cls(){
web_service_cmd
=
"
${
python_
}
${
web_service_py
}
& "
eval
${
web_service_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
5s
for
pipeline
in
${
pipeline_py
[*]
}
;
do
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_gpu_
${
pipeline
%_client*
}
_batchsize_1.log"
...
...
@@ -237,6 +241,8 @@ function func_serving_rec(){
web_service_cmd
=
"
${
python
}
${
web_service_py
}
&"
eval
${
web_service_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
5s
for
pipeline
in
${
pipeline_py
[*]
}
;
do
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_cpu_
${
pipeline
%_client*
}
_batchsize_1.log"
...
...
@@ -269,6 +275,8 @@ function func_serving_rec(){
web_service_cmd
=
"
${
python
}
${
web_service_py
}
& "
eval
${
web_service_cmd
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
web_service_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
sleep
10s
for
pipeline
in
${
pipeline_py
[*]
}
;
do
_save_log_path
=
"
${
LOG_PATH
}
/server_infer_gpu_
${
pipeline
%_client*
}
_batchsize_1.log"
...
...
@@ -290,7 +298,7 @@ function func_serving_rec(){
# set cuda device
GPUID
=
$2
if
[
${#
GPUID
}
-le
0
]
;
then
env
=
"
"
env
=
"
export CUDA_VISIBLE_DEVICES=0
"
else
env
=
"export CUDA_VISIBLE_DEVICES=
${
GPUID
}
"
fi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录