MinerU icon indicating copy to clipboard operation
MinerU copied to clipboard

Torch is incompatible

Open wd30x opened this issue 1 year ago • 10 comments

Description of the bug | 错误描述

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. torchaudio 2.4.0 requires torch==2.4.0, but you have torch 2.3.1 which is incompatible.

How to reproduce the bug | 如何复现

When running the following command, error happens.

pip install magic-pdf[full-cpu] detectron2 --extra-index-url https://myhloli.github.io/wheels/

Operating system | 操作系统

Windows

Python version | Python 版本

3.10

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

0.6.x

Device mode | 设备模式

cuda

wd30x avatar Jul 29 '24 16:07 wd30x

this project don't need torchaudio,so,what command do you input?

myhloli avatar Jul 29 '24 16:07 myhloli

As in https://pytorch.org/get-started/locally/ , I use conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia

wd30x avatar Jul 29 '24 16:07 wd30x

i think this way will be easy

pip install torch==2.3.1 torchvision=0.18.1 --index-url https://download.pytorch.org/whl/cu124

myhloli avatar Jul 29 '24 16:07 myhloli

Okay now I got ERROR: Could not find a version that satisfies the requirement torch==2.3.1 (from versions: 2.4.0+cu124) ERROR: No matching distribution found for torch==2.3.1

Edit: Turns out cuda1.24 is not supported on torch 2.3.1, I installed cuda1.21 instead.

wd30x avatar Jul 29 '24 16:07 wd30x

Now I got:

2024-07-30 02:19:19.642 | ERROR    | magic_pdf.model.pdf_extract_kit:<module>:24 - Required dependency not installed, please install by
"pip install magic-pdf[full-cpu] detectron2 --extra-index-url https://myhloli.github.io/wheels/"

wd30x avatar Jul 29 '24 17:07 wd30x

emmm, can you run it on cpu by your environment?if cpu work well,you can install torch with cuda by

pip install torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu118

myhloli avatar Jul 29 '24 18:07 myhloli

Same error happens.

wd30x avatar Jul 29 '24 18:07 wd30x

Same error happens.

if you can use git clone source and install by source with latest master batch, you will easy found what's wrong with import.

myhloli avatar Jul 29 '24 18:07 myhloli

Unfortunately, there is still some time until the next release, and the only way to troubleshoot the issue now is through this way.

myhloli avatar Jul 29 '24 18:07 myhloli

#240 I think the problem we encounter is the same. You can refer to it.

tuhang avatar Jul 29 '24 18:07 tuhang

We have updated to the 0.6.2b1 release, addressing and resolving the aforementioned issue.

myhloli avatar Aug 01 '24 02:08 myhloli

For anyone struggling. Top answer from here helped me: https://stackoverflow.com/a/76481449/4828157

emosGambler avatar Jan 28 '25 08:01 emosGambler