连续推理文件会报错
#16050
Replies: 2 comments
-
我这边也遇到一样的问题。后面测试每个线程创建自己的 pipeline对象后有所改善 |
Beta Was this translation helpful? Give feedback.
0 replies
-
请参考 #15621 |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
2025-07-14 15:56:45,654 - main - INFO - 开始处理文件: Temp\fefc2c16-05eb-460d-beaa-10fc305b5a3e\zzz.jpg
2025-07-14 15:56:47,054 - main - ERROR - OCR处理失败: Unknown exception
Traceback (most recent call last):
File "OCRcopy.py", line 73, in ocr1
result = ocr.predict(input=input_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "anaconda3\envs\OCR\Lib\site-packages\paddleocr_pipelines\ocr.py", line 208, in predict
return list(
^^^^^
File "anaconda3\envs\OCR\Lib\site-packages\paddlex\inference\pipelines_parallel.py", line 129, in predict
yield from self._pipeline.predict(
File "anaconda3\envs\OCR\Lib\site-packages\paddlex\inference\pipelines\ocr\pipeline.py", line 350, in predict
det_results = list(
^^^^^
File "anaconda3\envs\OCR\Lib\site-packages\paddlex\inference\models\base\predictor\base_predictor.py", line 211, in call
yield from self.apply(input, **kwargs)
File "anaconda3\envs\OCR\Lib\site-packages\paddlex\inference\models\base\predictor\base_predictor.py", line 267, in apply
prediction = self.process(batch_data, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "anaconda3\envs\OCR\Lib\site-packages\paddlex\inference\models\text_detection\predictor.py", line 105, in process
batch_preds = self.infer(x=x)
^^^^^^^^^^^^^^^
File "anaconda3\envs\OCR\Lib\site-packages\paddlex\inference\models\common\static_infer.py", line 287, in call
pred = self.infer(x)
^^^^^^^^^^^^^
File "anaconda3\envs\OCR\Lib\site-packages\paddlex\inference\models\common\static_infer.py", line 252, in call
self.predictor.run()
RuntimeError: Unknown exception
使用的Flask封装成一个接口,并在全局变量中加载本地模型实例,调用接口后第一次推理可出结果,但后续使用就会报该错误,在不关闭该接口的一段时间后可重新推理一次。
PaddleOCR 版本: 3.1.0
PaddlePaddle 版本: 3.1.0
python 3.12.11
Beta Was this translation helpful? Give feedback.
All reactions