bug/unstructured.paddleocr与PaddleOCR GPU版本不兼容,

ar5n3qh5  于 6个月前  发布在  其他
关注(0)|答案(1)|浏览(82)

在将OCR代理设置为Paddle并加载GPU模型时,我遇到了以下错误。

| During handling of the above exception, another exception occurred:

    | 

    |     if not paddle.fluid.core.is_compiled_with_rocm():

    |   File "/usr/local/lib/python3.9/site-packages/unstructured_paddleocr/paddle_tools/infer/utility.py", line 314, in get_infer_gpuid

    | AttributeError: module 'paddle' has no attribute 'fluid'

    |     return cls.get_instance(ocr_agent_cls_qname)

    |   File "/usr/local/lib/python3.9/site-packages/unstructured/partition/utils/ocr_models/ocr_interface.py", line 49, in get_instance

    |   File "/usr/local/lib/python3.9/site-packages/unstructured/partition/utils/ocr_models/ocr_interface.py", line 35, in get_agent

最终导致了以下错误:

|   File "/usr/local/lib/python3.9/site-packages/unstructured/partition/pdf.py", line 802, in _partition_pdf_or_image_with_ocr_from_image

    |     ocr_agent = OCRAgent.get_agent()

    |     page_elements = _partition_pdf_or_image_with_ocr_from_image(

    +------------------------------------

    | ValueError: Environment variable OCR_AGENT must be set to an existing OCR agent module, not unstructured.partition.utils.ocr_models.paddle_ocr.OCRAgentPaddle.

我认为问题可以通过将
if not paddle.fluid.core.is_compiled_with_rocm():
更改为
if not paddle.core.is_compiled_with_rocm(): 来解决。(第314行 in unstructured_paddleocr/paddle_tools/infer/utility.py )
我的依赖项:

unstructured             0.14.5
unstructured-client      0.23.3
unstructured-inference   0.7.34
unstructured.paddleocr   2.6.1.3
unstructured.pytesseract 0.3.12
paddleclas               2.5.2
paddleocr                2.7.3
paddlepaddle             2.6.1
paddlepaddle-gpu         2.6.1.post112
kxe2p93d

kxe2p93d1#

你好,@peixin-lin -感谢你的报告。我们不计划在开源中支持GPU,但如果我们将GPU支持添加到我们的SaaS产品中,我们可能会在unstructured.paddleocr中解决这个问题。

相关问题