How to avoid reloading PP-StructureV3 models on every request in Flask/Celery without std::exception crashes? #16589
Unanswered
Atulok0506
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Hello, for deployment, you can refer to the documentation at https://www.paddleocr.ai/latest/en/version3.x/deployment/serving.html. If you want to avoid loading the model every time, you can initialize the service with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using PP-StructureV3 in a Flask + Celery application.
If I reload the pipeline for each request, it works but is too slow (since it reloads ~6 models every time).
If I cache/reuse the pipeline across requests, the first request succeeds, but on the second one I get a std::exception crash from Paddle’s C++ backend.
This makes it look like Paddle’s internal state gets corrupted after reuse.
Question:
What is the recommended way to run PP-StructureV3 in a long-lived server environment (Flask/Celery)?
Is there an officially supported pattern for keeping the models loaded in memory across multiple requests?
Or is the only safe option to reload the pipeline each time or run it in short-lived subprocesses?
Do PaddleOCR/PaddleX developers recommend any workaround for avoiding std::exception while still getting reasonable performance?
Beta Was this translation helpful? Give feedback.
All reactions