PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.23k stars 7.82k forks source link

使用gunicorn+uvicorn+fastapi调用paddleocr时报错 #6025

Closed paopjian closed 2 years ago

paopjian commented 2 years ago

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem


C++ Traceback (most recent call last):

0 uv_run 1 paddle::AnalysisPredictor::ZeroCopyRun() 2 paddle::framework::NaiveExecutor::Run() 3 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&) 4 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const 5 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&, paddle::framework::RuntimeContext) const 6 std::_Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CPUPlace, false, 0ul, paddle::operators::EltwiseMKLDNNKernel<float, (dnnl::algorithm)131057>, paddle::operators::EltwiseMKLDNNKernel<paddle::platform::bfloat16, (dnnl::algorithm)131057>, paddle::operators::EltwiseMKLDNNKernel<signed char, (dnnl::algorithm)131057>, paddle::operators::EltwiseMKLDNNKernel<unsigned char, (dnnl::algorithm)131057> >::operator()(char const, char const*, int) const::{lambda(paddle::framework::ExecutionContext const&)#1}>::_M_invoke(std::_Any_data const&, paddle::framework::ExecutionContext const&) 7 paddle::operators::EltwiseMKLDNNKernel<float, (dnnl::algorithm)131057>::Compute(paddle::framework::ExecutionContext const&) const 8 dnnl::primitive::execute(dnnl::stream const&, std::unordered_map<int, dnnl::memory, std::hash, std::equal_to, std::allocator<std::pair<int const, dnnl::memory> > > const&) const 9 GOMP_parallel


Error Message Summary:

FatalError: Process abort signal is detected by the operating system. [TimeInfo: Aborted at 1650510808 (unix time) try "date -d @1650510808" if you are using GNU date ] [SignalInfo: SIGABRT (@0x3e8000015b7) received by PID 5560 (TID 0x7f51990fe180) from PID 5559 ]

[2022-04-21 11:13:29 +0800] [5559] [WARNING] Worker with pid 5560 was terminated due to signal 6



使用uvicorn启动没有报错,使用gunicorn管理uvicorn时paddle开始报错崩溃
854762363 commented 2 years ago

遇到了相同问题,请问有解决方案吗 [2022-08-18 10:09:41 ] [4260] [ERROR] Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/uvicorn/protocols/http/httptools_impl.py", line 372, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/local/lib/python3.7/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in call return await self.app(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/fastapi/applications.py", line 269, in call await super().call(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/applications.py", line 124, in call await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/middleware/errors.py", line 184, in call raise exc File "/usr/local/lib/python3.7/dist-packages/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/usr/local/lib/python3.7/dist-packages/starlette/exceptions.py", line 93, in call raise exc File "/usr/local/lib/python3.7/dist-packages/starlette/exceptions.py", line 82, in call await self.app(scope, receive, sender) File "/usr/local/lib/python3.7/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/usr/local/lib/python3.7/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/routing.py", line 670, in call await route.handle(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/routing.py", line 266, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.7/dist-packages/starlette/routing.py", line 65, in app response = await func(request) File "/usr/local/lib/python3.7/dist-packages/fastapi/routing.py", line 228, in app dependant=dependant, values=values, is_coroutine=is_coroutine File "/usr/local/lib/python3.7/dist-packages/fastapi/routing.py", line 162, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/usr/local/lib/python3.7/dist-packages/starlette/concurrency.py", line 41, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/usr/local/lib/python3.7/dist-packages/anyio/to_thread.py", line 32, in run_sync func, args, cancellable=cancellable, limiter=limiter File "/usr/local/lib/python3.7/dist-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "/usr/local/lib/python3.7/dist-packages/anyio/_backends/_asyncio.py", line 867, in run result = context.run(func, args) File "/home/zqjc-ztsb/deploy/app.py", line 260, in zqjc rst_lst.extend(ocr_reco(bgr_img, data.pre_sign)) File "/home/zqjc-ztsb/deploy/app.py", line 122, in ocr_reco dt_boxes, rec_res = system_predictor.text_sys(img[:tmp_h]) File "/home/zqjc-ztsb/deploy/tools/infer/predict_system.py", line 69, in call dt_boxes, elapse = self.text_detector(img) File "/home/zqjc-ztsb/deploy/tools/infer/predict_det.py", line 218, in call self.predictor.run() RuntimeError: could not execute a primitive