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)
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