paddlex 使用cpu cv 预处理偶发报错
Search before asking
- I have searched the PaddleOCR Docs and found no similar bug report.
- I have searched the PaddleOCR Issues and found no similar bug report.
- I have searched the PaddleOCR Discussions and found no similar bug report.
Bug (问题描述)
接口调用偶发 RuntimeError: Exception from the 'cv' worker: std::exception INFO: 10.152.6.143:64858 - "POST /layout-parsing HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 421, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 63, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1159, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 107, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 63, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 716, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 736, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 290, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 134, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 120, in app response = await f(request) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 674, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 328, in run_endpoint_function return await dependant.call(**values) File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_pipeline_apps/paddleocr_vl.py", line 66, in _infer result = await pipeline.infer( File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 111, in infer return await self.call(_infer, *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 121, in call return await fut File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 139, in _worker result = func(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 102, in _infer for item in it: File "/usr/local/lib/python3.10/site-packages/paddlex/inference/pipelines/_parallel.py", line 161, in predict yield from self._pipeline.predict( File "/usr/local/lib/python3.10/site-packages/paddlex/inference/pipelines/paddleocr_vl/pipeline.py", line 1179, in predict raise RuntimeError( RuntimeError: Exception from the 'cv' worker: std::exception
接口调用偶发 RuntimeError: Exception from the 'cv' worker: std::exception INFO: 10.152.6.143:64858 - "POST /layout-parsing HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 421, in run_asgi result = await app( # type: ignore[func-returns-value] File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 63, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1159, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 107, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in call raise exc File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 63, in call await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 716, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 736, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 290, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 134, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 120, in app response = await f(request) File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 674, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 328, in run_endpoint_function return await dependant.call(**values) File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_pipeline_apps/paddleocr_vl.py", line 66, in _infer result = await pipeline.infer( File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 111, in infer return await self.call(_infer, *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 121, in call return await fut File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 139, in _worker result = func(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/paddlex/inference/serving/basic_serving/_app.py", line 102, in _infer for item in it: File "/usr/local/lib/python3.10/site-packages/paddlex/inference/pipelines/_parallel.py", line 161, in predict yield from self._pipeline.predict( File "/usr/local/lib/python3.10/site-packages/paddlex/inference/pipelines/paddleocr_vl/pipeline.py", line 1179, in predict raise RuntimeError( RuntimeError: Exception from the 'cv' worker: std::exception
♂️ Environment (运行环境)
paddlepaddle==3.3.0 paddlex==3.6.1
使用paddlex 服务化部署 padde-vl client 重要参数如下 use_doc_preprocessor: true use_doc_unwarping: true
SubPipelines: DocPreprocessor: use_doc_orientation_classify: true use_doc_unwarping: true SubModules: DocUnwarping: module_name: image_unwarping model_name: UVDoc
Minimal Reproducible Example (最小可复现问题的Demo)
使用paddlex 服务化部署 padde-vl client
use_doc_preprocessor: true use_doc_unwarping: true
SubPipelines: DocPreprocessor: use_doc_orientation_classify: true use_doc_unwarping: true SubModules: DocUnwarping: module_name: image_unwarping model_name: UVDoc
Source: PaddlePaddle/PaddleOCR