-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Centos7环境下,通过docker部署mineru,启动报错 #4362
Replies: 1 comment · 11 replies
-
|
Hi @leavesosoon! I'm Dosu and I’m helping the MinerU team. 你遇到的启动报错,根本原因是 MinerU 官方 Docker 镜像(包括 2.7.0 版本)默认集成了 vLLM 推理加速和 CUDA 相关依赖,只适用于 GPU 环境,不支持纯 CPU 场景。直接在 CentOS 7 的 CPU-only 环境下用官方镜像启动,会因为缺少 GPU 驱动或 CUDA 环境导致报错,常见现象包括容器反复重启、主进程无法启动、依赖报错等相关说明。 解决方法:需要自定义构建 CPU 专用镜像,步骤如下:
常见坑位与排查建议:
如果按上述方法自定义镜像后仍有报错,请提供具体的启动命令和完整的容器日志(docker logs),这样可以进一步精准定位问题。 To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
您好,我完整复现一下我的问题。 docker run -it --rm 详细报错日志: File "/usr/local/bin/mineru-gradio", line 7, in
TypeError: ModelSingleton.get_model() got multiple values for argument 'backend'
|
Beta Was this translation helpful? Give feedback.
All reactions
-
|
打开的界面上面会默认选择一个后端解析模型【hybrid-auto-engine】,还有另外两个选项,vlm-auto-engine和pipeline。无论我怎么选择这个选项,都会报错。我看日志里面是提示的backend参数重复了,有多个。我的页面上面也有参数,在请求的时候应该也会送到后端,我的启动命令上面也有backend参数,会不会和这个有关系。然后我尝试在启动命令上面去掉backend参数,用页面上面的传参,启动命令如下: docker run -it --rm 然后又报错提示Device string must not be empty,这样看的话backend和device参数传递的都有问题。详细日志如下: 2026-01-14 19:12:58.161 | INFO | mineru.utils.engine_utils:get_vlm_engine:32 - Using vllm-async-engine as the inference engine for VLM. File "/usr/local/bin/mineru-gradio", line 7, in
RuntimeError: Device string must not be empty
|
Beta Was this translation helpful? Give feedback.
All reactions
-
|
你的分析完全正确, 解决方法有两种安全模式(二选一): A. 推荐:只在 CLI 启动命令里指定 backend 和 device,WebUI 不要切换后端 这样 WebUI 的后端下拉框选项就不要动,始终用 CLI 指定的 pipeline,页面不用切换后端,否则还是会冲突。 docker run -it --rm \
-p 7860:7860 \
-v /root/data/disk/mineru/input:/app/data \
mineru-myself-build-cpu:2.7.1 \
mineru-gradio --server-name 0.0.0.0 --server-port 7860 --backend pipeline --device cpu注意:WebUI 的后端下拉框不要切换,始终用 pipeline。 B. 或者:CLI 不传 backend,device 用环境变量指定,WebUI 选择后端 如果你想让 WebUI 可以切换后端(比如 pipeline/vlm-auto-engine/hybrid-auto-engine),CLI 启动命令不要加 docker run -it --rm \
-p 7860:7860 \
-v /root/data/disk/mineru/input:/app/data \
-e MINERU_DEVICE_MODE=cpu \
mineru-myself-build-cpu:2.7.1 \
mineru-gradio --server-name 0.0.0.0 --server-port 7860这样 device 就不会为空,WebUI 选择 pipeline 时会自动用 cpu,选择其他后端时如果不支持 CPU 会报错(比如 hybrid-auto-engine/vlm-auto-engine 需要 GPU)。 注意事项:
最佳实践:
本质:mineru-gradio 没有自动去重机制,CLI 和 WebUI 参数会合并,重复就报错。 如需进一步自定义默认后端(比如让 WebUI 默认 pipeline),可以在前端代码里把默认值改成 pipeline,或者用浏览器开发者工具手动修改默认选项。 如还有疑问可继续贴日志或命令。 To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
我用了你提供的B方案,CLI 不传 backend,device 用环境变量指定,WebUI 选择后端pipeline。命令如下: 但是启动的时候还是提示:Device string must not be empty,且我上传了一个PDF,前端选择pipeline尝试进行解析,文件能预览,但是无法转换,转换的时候报错:TypeError: cannot unpack non-iterable NoneType object。 以下是详细日志: 2026-01-14 19:45:38.177 | INFO | mineru.utils.engine_utils:get_vlm_engine:32 - Using vllm-async-engine as the inference engine for VLM. File "/usr/local/bin/mineru-gradio", line 7, in
RuntimeError: Device string must not be empty
RuntimeError: unable to mmap 810036696 bytes from file </root/.cache/modelscope/hub/models/OpenDataLab/PDF-Extract-Kit-1___0/models/MFR/unimernet_hf_small_2503/model.safetensors>: Cannot allocate memory (12) |
Beta Was this translation helpful? Give feedback.
All reactions
-
|
你的问题有两个核心原因:
解决建议:
参考: 如还有具体内存配置、模型路径等问题,可以贴下 To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
我在Centos7操作系统中,纯CPU环境,通过轩辕镜像站点下载的2.7.0版本的镜像,通过docker部署和启动。启动命令如下:
docker run -d
--name mineru-webui
-p 7860:7860
-e MINERU_DEVICE_MODE=cpu
-v /root/data/disk/mineru/input:/app/data
docker.xuanyuan.run/alexsuntop/mineru:2.7.0
mineru-gradio --server-name 0.0.0.0 --server-port 7860
mineru-webui可以访问,但是上传pdf之后,出现报错:
2026-01-13 18:35:41.173 | INFO | mineru.utils.engine_utils:get_vlm_engine:32 - Using vllm-async-engine as the inference engine for VLM.
2026-01-13 18:35:41.174 | INFO | mineru.cli.gradio_app:main:388 - Start init vllm-async-engine...
INFO 01-13 18:35:42 [init.py:245] No platform detected, vLLM is running on UnspecifiedPlatform
2026-01-13 18:35:44.046 | INFO | mineru.backend.vlm.utils:enable_custom_logits_processors:22 - CUDA not available, disabling custom_logits_processors
2026-01-13 18:35:44.076 | ERROR | mineru.cli.gradio_app:main:399 - Device string must not be empty
根据日志来看,平台和cuda没检测到,然后Device string must not be empty这一句报错,我尝试用环境变量指定为CPU,但是依旧提示这个错误
Beta Was this translation helpful? Give feedback.
All reactions