PaddlePaddle / PaddlePaddle/FastDeploy
PaddleOCR服务化部署仅能识别样例图片,其他任何图片都报错无法正常识别
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 756
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 4
Description
- 【FastDeploy版本】fastdeploy:1.0.4-gpu-cuda11.4-trt8.5-21.10
- 【编译命令】参考(https://github.com/PaddlePaddle/FastDeploy/tree/develop/examples/vision/ocr/PP-OCR/serving/fastdeploy_serving)
- 【系统平台】: Linux x64
- 【硬件】: Nvidia GPU Tesla P4, CUDA 11.6 CUDNN 8.5
- 【编译语言】:Python(3.9)
问题日志及出现问题的操作流程
- 【无法正常识别样例以外的图片】
-
- 先执行
examples下的部署示例,包括使用examples提供的模型,确认可以正确执行
- 先执行
-
- 按照教程,服务端运行后,在客户端运行python3 client.py,对于样例图片12.jpg可以正常识别,识别结果:
-(ocr) [topsci@localhost fastdeploy_serving]$ python3 client.py
text= 上海斯格威铂尔大酒店 score= 0.9804123044013977 bbox= [ 42 413 483 391 484 428 43 450]
text= 打浦路15号 score= 0.9606184363365173 bbox= [187 456 399 448 400 480 188 488]
text= 绿洲仕格维花园公寓 score= 0.9806857705116272 bbox= [ 23 507 513 488 515 529 24 548]
text= 打浦路252935号 score= 0.9498506784439087 bbox= [ 74 553 427 542 428 571 75 582]
- 按照教程,服务端运行后,在客户端运行python3 client.py,对于样例图片12.jpg可以正常识别,识别结果:
-- 如果更改client.py文件中的图片,例如将im = cv2.imread("12.jpg")改为im = cv2.imread("002.jpg"),“002.jpg”为另一张图片,则会报错,报错内容:
-(ocr) [topsci@localhost fastdeploy_serving]$ python3 client.py
Traceback (most recent call last):
File "/home/topsci/code/OCR/fastdeploy_serving/client.py", line 100, in
result = runner.Run([im, ])
File "/home/topsci/code/OCR/fastdeploy_serving/client.py", line 71, in Run
results = self._client.infer(
File "/home/topsci/anaconda3/envs/ocr/lib/python3.9/site-packages/tritonclient/grpc/init.py", line 1446, in infer
raise_error_grpc(rpc_error)
File "/home/topsci/anaconda3/envs/ocr/lib/python3.9/site-packages/tritonclient/grpc/init.py", line 76, in raise_error_grpc
raise get_error_grpc(rpc_error) from None
tritonclient.utils.InferenceServerException: [StatusCode.INTERNAL] in ensemble 'pp_ocr', Failed to process the request(s) for model instance 'det_postprocess_0', message: TritonModelException: in ensemble 'cls_pp', softmax_0.tmp_0: failed to perform CUDA copy: invalid argument
At:
/ocr_serving/code/OCR/fastdeploy_serving/models/det_postprocess/1/model.py(176): execute
想问一下这是怎么回事。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the serving example and client.py, comparing the successful 12.jpg request with 002.jpg. Then inspect models/det_postprocess/1/model.py around line 176 and the Triton pp_ocr/cls_pp execution path. Done means identifying and resolving why non-sample images trigger the CUDA copy error, with both image cases completing successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100