Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
ffe4eb02
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看板
未验证
提交
ffe4eb02
编写于
4月 06, 2021
作者:
T
TeslaZhao
提交者:
GitHub
4月 06, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1113 from TeslaZhao/develop
fix bugs for importing cpu/gpu server in examples
上级
ce8f5d6a
d87f0a65
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
60 addition
and
93 deletion
+60
-93
python/examples/bert/bert_gpu_server.py
python/examples/bert/bert_gpu_server.py
+3
-3
python/examples/bert/bert_web_service_gpu.py
python/examples/bert/bert_web_service_gpu.py
+1
-1
python/examples/detection/faster_rcnn_hrnetv2p_w18_1x/README.md
.../examples/detection/faster_rcnn_hrnetv2p_w18_1x/README.md
+1
-1
python/examples/detection/faster_rcnn_hrnetv2p_w18_1x/README_CN.md
...amples/detection/faster_rcnn_hrnetv2p_w18_1x/README_CN.md
+1
-1
python/examples/detection/fcos_dcn_r50_fpn_1x_coco/README.md
python/examples/detection/fcos_dcn_r50_fpn_1x_coco/README.md
+1
-2
python/examples/detection/fcos_dcn_r50_fpn_1x_coco/README_CN.md
.../examples/detection/fcos_dcn_r50_fpn_1x_coco/README_CN.md
+1
-2
python/examples/detection/ssd_vgg16_300_240e_voc/README.md
python/examples/detection/ssd_vgg16_300_240e_voc/README.md
+1
-2
python/examples/detection/ssd_vgg16_300_240e_voc/README_CN.md
...on/examples/detection/ssd_vgg16_300_240e_voc/README_CN.md
+1
-2
python/examples/fit_a_line/test_server.py
python/examples/fit_a_line/test_server.py
+1
-4
python/examples/grpc_impl_example/fit_a_line/test_server_gpu.py
.../examples/grpc_impl_example/fit_a_line/test_server_gpu.py
+3
-3
python/examples/imagenet/resnet50_web_service.py
python/examples/imagenet/resnet50_web_service.py
+1
-1
python/examples/imdb/text_classify_service.py
python/examples/imdb/text_classify_service.py
+1
-5
python/examples/lac/lac_web_service.py
python/examples/lac/lac_web_service.py
+1
-4
python/examples/ocr/det_debugger_server.py
python/examples/ocr/det_debugger_server.py
+1
-1
python/examples/ocr/det_web_server.py
python/examples/ocr/det_web_server.py
+1
-1
python/examples/ocr/ocr_debugger_server.py
python/examples/ocr/ocr_debugger_server.py
+1
-1
python/examples/ocr/rec_debugger_server.py
python/examples/ocr/rec_debugger_server.py
+1
-1
python/examples/ocr/rec_web_server.py
python/examples/ocr/rec_web_server.py
+1
-1
python/examples/pipeline/bert/pipeline_rpc_client.py
python/examples/pipeline/bert/pipeline_rpc_client.py
+25
-15
python/examples/pipeline/bert/web_service.py
python/examples/pipeline/bert/web_service.py
+1
-4
python/examples/pipeline/imagenet/resnet50_web_service.py
python/examples/pipeline/imagenet/resnet50_web_service.py
+1
-4
python/examples/pipeline/imdb_model_ensemble/test_pipeline_server.py
...ples/pipeline/imdb_model_ensemble/test_pipeline_server.py
+5
-12
python/examples/pipeline/ocr/web_service.py
python/examples/pipeline/ocr/web_service.py
+1
-4
python/examples/pipeline/simple_web_service/web_service.py
python/examples/pipeline/simple_web_service/web_service.py
+2
-4
python/examples/pipeline/simple_web_service/web_service_java.py
.../examples/pipeline/simple_web_service/web_service_java.py
+1
-4
python/examples/senta/senta_web_service.py
python/examples/senta/senta_web_service.py
+1
-5
python/examples/xpu/fit_a_line_xpu/test_server.py
python/examples/xpu/fit_a_line_xpu/test_server.py
+1
-5
未找到文件。
python/examples/bert/bert_gpu_server.py
浏览文件 @
ffe4eb02
...
...
@@ -14,9 +14,9 @@
import
os
import
sys
from
paddle_serving_server
_gpu
import
OpMaker
from
paddle_serving_server
_gpu
import
OpSeqMaker
from
paddle_serving_server
_gpu
import
Server
from
paddle_serving_server
import
OpMaker
from
paddle_serving_server
import
OpSeqMaker
from
paddle_serving_server
import
Server
op_maker
=
OpMaker
()
read_op
=
op_maker
.
create
(
'general_reader'
)
...
...
python/examples/bert/bert_web_service_gpu.py
浏览文件 @
ffe4eb02
...
...
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=doc-string-missing
from
paddle_serving_server
_gpu
.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_app.reader
import
ChineseBertReader
import
sys
import
os
...
...
python/examples/detection/faster_rcnn_hrnetv2p_w18_1x/README.md
浏览文件 @
ffe4eb02
...
...
@@ -10,7 +10,7 @@ wget --no-check-certificate https://paddle-serving.bj.bcebos.com/pddet_demo/2.0/
### Start the service
```
tar xf faster_rcnn_hrnetv2p_w18_1x.tar
python -m paddle_serving_server
_gpu
.serve --model serving_server --port 9494 --gpu_ids 0
python -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ids 0
```
This model support TensorRT, if you want a faster inference, please use
`--use_trt`
.
...
...
python/examples/detection/faster_rcnn_hrnetv2p_w18_1x/README_CN.md
浏览文件 @
ffe4eb02
...
...
@@ -11,7 +11,7 @@ wget --no-check-certificate https://paddle-serving.bj.bcebos.com/pddet_demo/2.0/
### 启动服务
```
tar xf faster_rcnn_hrnetv2p_w18_1x.tar
python -m paddle_serving_server
_gpu
.serve --model serving_server --port 9494 --gpu_ids 0
python -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ids 0
```
该模型支持TensorRT,如果想要更快的预测速度,可以开启
`--use_trt`
选项。
...
...
python/examples/detection/fcos_dcn_r50_fpn_1x_coco/README.md
浏览文件 @
ffe4eb02
...
...
@@ -10,7 +10,7 @@ wget --no-check-certificate https://paddle-serving.bj.bcebos.com/pddet_demo/2.0/
### Start the service
```
tar xf fcos_dcn_r50_fpn_1x_coco.tar
python -m paddle_serving_server
_gpu
.serve --model serving_server --port 9494 --gpu_ids 0
python -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ids 0
```
This model support TensorRT, if you want a faster inference, please use
`--use_trt`
.
...
...
@@ -18,4 +18,3 @@ This model support TensorRT, if you want a faster inference, please use `--use_t
```
python test_client.py 000000570688.jpg
```
python/examples/detection/fcos_dcn_r50_fpn_1x_coco/README_CN.md
浏览文件 @
ffe4eb02
...
...
@@ -11,7 +11,7 @@ wget --no-check-certificate https://paddle-serving.bj.bcebos.com/pddet_demo/2.0/
### 启动服务
```
tar xf fcos_dcn_r50_fpn_1x_coco.tar
python -m paddle_serving_server
_gpu
.serve --model serving_server --port 9494 --gpu_ids 0
python -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ids 0
```
该模型支持TensorRT,如果想要更快的预测速度,可以开启
`--use_trt`
选项。
...
...
@@ -20,4 +20,3 @@ python -m paddle_serving_server_gpu.serve --model serving_server --port 9494 --g
```
python test_client.py 000000570688.jpg
```
python/examples/detection/ssd_vgg16_300_240e_voc/README.md
浏览文件 @
ffe4eb02
...
...
@@ -10,7 +10,7 @@ wget --no-check-certificate https://paddle-serving.bj.bcebos.com/pddet_demo/2.0/
### Start the service
```
tar xf ssd_vgg16_300_240e_voc.tar
python -m paddle_serving_server
_gpu
.serve --model serving_server --port 9494 --gpu_ids 0
python -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ids 0
```
This model support TensorRT, if you want a faster inference, please use
`--use_trt`
.
...
...
@@ -18,4 +18,3 @@ This model support TensorRT, if you want a faster inference, please use `--use_t
```
python test_client.py 000000570688.jpg
```
python/examples/detection/ssd_vgg16_300_240e_voc/README_CN.md
浏览文件 @
ffe4eb02
...
...
@@ -11,7 +11,7 @@ wget --no-check-certificate https://paddle-serving.bj.bcebos.com/pddet_demo/2.0/
### 启动服务
```
tar xf ssd_vgg16_300_240e_voc.tar
python -m paddle_serving_server
_gpu
.serve --model serving_server --port 9494 --gpu_ids 0
python -m paddle_serving_server.serve --model serving_server --port 9494 --gpu_ids 0
```
该模型支持TensorRT,如果想要更快的预测速度,可以开启
`--use_trt`
选项。
...
...
@@ -20,4 +20,3 @@ python -m paddle_serving_server_gpu.serve --model serving_server --port 9494 --g
```
python test_client.py 000000570688.jpg
```
python/examples/fit_a_line/test_server.py
浏览文件 @
ffe4eb02
...
...
@@ -13,10 +13,7 @@
# limitations under the License.
# pylint: disable=doc-string-missing
try
:
from
paddle_serving_server_gpu.web_service
import
WebService
except
ImportError
:
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
import
numpy
as
np
...
...
python/examples/grpc_impl_example/fit_a_line/test_server_gpu.py
浏览文件 @
ffe4eb02
...
...
@@ -15,9 +15,9 @@
import
os
import
sys
from
paddle_serving_server
_gpu
import
OpMaker
from
paddle_serving_server
_gpu
import
OpSeqMaker
from
paddle_serving_server
_gpu
import
MultiLangServer
as
Server
from
paddle_serving_server
import
OpMaker
from
paddle_serving_server
import
OpSeqMaker
from
paddle_serving_server
import
MultiLangServer
as
Server
op_maker
=
OpMaker
()
read_op
=
op_maker
.
create
(
'general_reader'
)
...
...
python/examples/imagenet/resnet50_web_service.py
浏览文件 @
ffe4eb02
...
...
@@ -25,7 +25,7 @@ device = sys.argv[2]
if
device
==
"cpu"
:
from
paddle_serving_server.web_service
import
WebService
else
:
from
paddle_serving_server
_gpu
.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
class
ImageService
(
WebService
):
...
...
python/examples/imdb/text_classify_service.py
浏览文件 @
ffe4eb02
...
...
@@ -13,11 +13,7 @@
# limitations under the License.
# pylint: disable=doc-string-missing
try
:
from
paddle_serving_server.web_service
import
WebService
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_app.reader.imdb_reader
import
IMDBDataset
import
sys
import
numpy
as
np
...
...
python/examples/lac/lac_web_service.py
浏览文件 @
ffe4eb02
...
...
@@ -12,10 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
try
:
from
paddle_serving_server.web_service
import
WebService
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
import
sys
from
paddle_serving_app.reader
import
LACReader
import
numpy
as
np
...
...
python/examples/ocr/det_debugger_server.py
浏览文件 @
ffe4eb02
...
...
@@ -22,7 +22,7 @@ from paddle_serving_app.reader import Sequential, ResizeByFactor
from
paddle_serving_app.reader
import
Div
,
Normalize
,
Transpose
from
paddle_serving_app.reader
import
DBPostProcess
,
FilterBoxes
if
sys
.
argv
[
1
]
==
'gpu'
:
from
paddle_serving_server
_gpu
.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
elif
sys
.
argv
[
1
]
==
'cpu'
:
from
paddle_serving_server.web_service
import
WebService
import
time
...
...
python/examples/ocr/det_web_server.py
浏览文件 @
ffe4eb02
...
...
@@ -22,7 +22,7 @@ from paddle_serving_app.reader import Sequential, ResizeByFactor
from
paddle_serving_app.reader
import
Div
,
Normalize
,
Transpose
from
paddle_serving_app.reader
import
DBPostProcess
,
FilterBoxes
if
sys
.
argv
[
1
]
==
'gpu'
:
from
paddle_serving_server
_gpu
.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
elif
sys
.
argv
[
1
]
==
'cpu'
:
from
paddle_serving_server.web_service
import
WebService
import
time
...
...
python/examples/ocr/ocr_debugger_server.py
浏览文件 @
ffe4eb02
...
...
@@ -23,7 +23,7 @@ from paddle_serving_app.reader import Sequential, URL2Image, ResizeByFactor
from
paddle_serving_app.reader
import
Div
,
Normalize
,
Transpose
from
paddle_serving_app.reader
import
DBPostProcess
,
FilterBoxes
,
GetRotateCropImage
,
SortedBoxes
if
sys
.
argv
[
1
]
==
'gpu'
:
from
paddle_serving_server
_gpu
.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
elif
sys
.
argv
[
1
]
==
'cpu'
:
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_app.local_predict
import
LocalPredictor
...
...
python/examples/ocr/rec_debugger_server.py
浏览文件 @
ffe4eb02
...
...
@@ -23,7 +23,7 @@ from paddle_serving_app.reader import Sequential, URL2Image, ResizeByFactor
from
paddle_serving_app.reader
import
Div
,
Normalize
,
Transpose
from
paddle_serving_app.reader
import
DBPostProcess
,
FilterBoxes
,
GetRotateCropImage
,
SortedBoxes
if
sys
.
argv
[
1
]
==
'gpu'
:
from
paddle_serving_server
_gpu
.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
elif
sys
.
argv
[
1
]
==
'cpu'
:
from
paddle_serving_server.web_service
import
WebService
import
time
...
...
python/examples/ocr/rec_web_server.py
浏览文件 @
ffe4eb02
...
...
@@ -23,7 +23,7 @@ from paddle_serving_app.reader import Sequential, URL2Image, ResizeByFactor
from
paddle_serving_app.reader
import
Div
,
Normalize
,
Transpose
from
paddle_serving_app.reader
import
DBPostProcess
,
FilterBoxes
,
GetRotateCropImage
,
SortedBoxes
if
sys
.
argv
[
1
]
==
'gpu'
:
from
paddle_serving_server
_gpu
.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
elif
sys
.
argv
[
1
]
==
'cpu'
:
from
paddle_serving_server.web_service
import
WebService
import
time
...
...
python/examples/pipeline/bert/pipeline_rpc_client.py
浏览文件 @
ffe4eb02
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
sys
import
os
import
yaml
import
requests
import
time
import
json
try
:
from
paddle_serving_server_gpu.pipeline
import
PipelineClient
except
ImportError
:
from
paddle_serving_server.pipeline
import
PipelineClient
from
paddle_serving_server.pipeline
import
PipelineClient
import
numpy
as
np
client
=
PipelineClient
()
client
.
connect
([
'127.0.0.1:9998'
])
batch_size
=
101
with
open
(
"data-c.txt"
,
'r'
)
as
fin
:
lines
=
fin
.
readlines
()
start_idx
=
0
while
start_idx
<
len
(
lines
):
end_idx
=
min
(
len
(
lines
),
start_idx
+
batch_size
)
feed
=
{}
for
i
in
range
(
start_idx
,
end_idx
):
feed
[
str
(
i
-
start_idx
)]
=
lines
[
i
]
ret
=
client
.
predict
(
feed_dict
=
feed
,
fetch
=
[
"res"
])
print
(
ret
)
start_idx
+=
batch_size
lines
=
fin
.
readlines
()
start_idx
=
0
while
start_idx
<
len
(
lines
):
end_idx
=
min
(
len
(
lines
),
start_idx
+
batch_size
)
feed
=
{}
for
i
in
range
(
start_idx
,
end_idx
):
feed
[
str
(
i
-
start_idx
)]
=
lines
[
i
]
ret
=
client
.
predict
(
feed_dict
=
feed
,
fetch
=
[
"res"
])
print
(
ret
)
start_idx
+=
batch_size
python/examples/pipeline/bert/web_service.py
浏览文件 @
ffe4eb02
...
...
@@ -11,10 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try
:
from
paddle_serving_server_gpu.web_service
import
WebService
,
Op
except
ImportError
:
from
paddle_serving_server.web_service
import
WebService
,
Op
from
paddle_serving_server.web_service
import
WebService
,
Op
import
logging
import
numpy
as
np
import
sys
...
...
python/examples/pipeline/imagenet/resnet50_web_service.py
浏览文件 @
ffe4eb02
...
...
@@ -13,10 +13,7 @@
# limitations under the License.
import
sys
from
paddle_serving_app.reader
import
Sequential
,
URL2Image
,
Resize
,
CenterCrop
,
RGB2BGR
,
Transpose
,
Div
,
Normalize
,
Base64ToImage
try
:
from
paddle_serving_server.web_service
import
WebService
,
Op
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
,
Op
from
paddle_serving_server.web_service
import
WebService
,
Op
import
logging
import
numpy
as
np
import
base64
,
cv2
...
...
python/examples/pipeline/imdb_model_ensemble/test_pipeline_server.py
浏览文件 @
ffe4eb02
...
...
@@ -15,18 +15,11 @@
import
numpy
as
np
from
paddle_serving_app.reader.imdb_reader
import
IMDBDataset
import
logging
try
:
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_server.pipeline
import
Op
,
RequestOp
,
ResponseOp
from
paddle_serving_server.pipeline
import
PipelineServer
from
paddle_serving_server.pipeline.proto
import
pipeline_service_pb2
from
paddle_serving_server.pipeline.channel
import
ChannelDataErrcode
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
from
paddle_serving_server_gpu.pipeline
import
Op
,
RequestOp
,
ResponseOp
from
paddle_serving_server_gpu.pipeline
import
PipelineServer
from
paddle_serving_server_gpu.pipeline.proto
import
pipeline_service_pb2
from
paddle_serving_server_gpu.pipeline.channel
import
ChannelDataErrcode
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_server.pipeline
import
Op
,
RequestOp
,
ResponseOp
from
paddle_serving_server.pipeline
import
PipelineServer
from
paddle_serving_server.pipeline.proto
import
pipeline_service_pb2
from
paddle_serving_server.pipeline.channel
import
ChannelDataErrcode
_LOGGER
=
logging
.
getLogger
()
user_handler
=
logging
.
StreamHandler
()
...
...
python/examples/pipeline/ocr/web_service.py
浏览文件 @
ffe4eb02
...
...
@@ -11,10 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try
:
from
paddle_serving_server_gpu.web_service
import
WebService
,
Op
except
ImportError
:
from
paddle_serving_server.web_service
import
WebService
,
Op
from
paddle_serving_server.web_service
import
WebService
,
Op
import
logging
import
numpy
as
np
import
cv2
...
...
python/examples/pipeline/simple_web_service/web_service.py
浏览文件 @
ffe4eb02
...
...
@@ -11,10 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try
:
from
paddle_serving_server.web_service
import
WebService
,
Op
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
,
Op
from
paddle_serving_server.web_service
import
WebService
,
Op
import
logging
import
numpy
as
np
import
sys
...
...
python/examples/pipeline/simple_web_service/web_service_java.py
浏览文件 @
ffe4eb02
...
...
@@ -11,10 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try
:
from
paddle_serving_server.web_service
import
WebService
,
Op
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
,
Op
from
paddle_serving_server.web_service
import
WebService
,
Op
import
logging
import
numpy
as
np
from
numpy
import
array
...
...
python/examples/senta/senta_web_service.py
浏览文件 @
ffe4eb02
...
...
@@ -16,11 +16,7 @@
import
os
import
sys
import
numpy
as
np
try
:
from
paddle_serving_server.web_service
import
WebService
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
from
paddle_serving_client
import
Client
from
paddle_serving_app.reader
import
LACReader
,
SentaReader
...
...
python/examples/xpu/fit_a_line_xpu/test_server.py
浏览文件 @
ffe4eb02
...
...
@@ -13,11 +13,7 @@
# limitations under the License.
# pylint: disable=doc-string-missing
try
:
from
paddle_serving_server.web_service
import
WebService
except
ImportError
:
from
paddle_serving_server_gpu.web_service
import
WebService
from
paddle_serving_server.web_service
import
WebService
import
numpy
as
np
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录