opendatalab / MinerU

A one-stop, open-source, high-quality data extraction tool, supports PDF/webpage/e-book extraction.一站式开源高质量数据提取工具,支持PDF/网页/多格式电子书提取。
https://opendatalab.com/OpenSourceTools
GNU Affero General Public License v3.0
11.44k stars 858 forks source link

新版本cpu demo无法安装成功,模型检验之后应该是完整的,不清楚是不是pip install magic-pdf[full] --extra-index-url https://myhloli.github.io/wheels/下载不全导致的 #640

Open hxypqr opened 3 hours ago

hxypqr commented 3 hours ago

Description of the bug | 错误描述

按最新一版 Quick CPU Demo说明 部署,报错:缺失依赖库 preserve_channel_dim。

事后尝试重新安装 albumentations 和albucore库的不同版本,但仍无法解决问题。该函数无法从 albucore.utils 导入。

How to reproduce the bug | 如何复现

pip install magic-pdf[full] --extra-index-url https://myhloli.github.io/wheels/ magic-pdf -p "C:/Users/xxx/Downloads/bdfbfd/2407.10759v1.pdf" -o "C:/Users/xxx/Downloads/bdfbfd/output" -m auto

magic-pdf.json 配置如下:

{ "models-dir":"C:/Users/hxypq/Downloads/PDF-Extract-Kit/models", "device-mode":"cpu", "table-config": { "is_table_recog_enable": false, "max_time": 400 } }

执行时返回以下错误:

2024-09-21 12:45:31.588 | ERROR | magic_pdf.model.pdf_extract_kit::28 - cannot import name 'preserve_channel_dim' from 'albucore.utils' (C:\Users\xxx\anaconda3\envs\MinerU\lib\site-packages\albucore\utils.py)

Traceback (most recent call last):

File "C:\Users\xxx\anaconda3\envs\MinerU\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, ... File "C:\Users\xxx\anaconda3\envs\MinerU\lib\site-packages\albumentations\augmentations\blur\functional.py", line 9, in from albucore.utils import clipped, maybe_process_in_chunks, preserve_channel_dim

ImportError: cannot import name 'preserve_channel_dim' from 'albucore.utils' (C:\Users\xxx\anaconda3\envs\MinerU\lib\site-packages\albucore\utils.py)

Operating system | 操作系统

Windows

Python version | Python 版本

3.10

Software version | 软件版本 (magic-pdf --version)

0.8.x

Device mode | 设备模式

cpu

myhloli commented 3 hours ago

https://github.com/albumentations-team/albucore/issues/33

可以先临时降级回0.0.15尝试解决该问题

hxypqr commented 1 hour ago

降级之后可以正常使用,感谢。