Torch is incompatible
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
this project don't need torchaudio,so,what command do you input?
As in https://pytorch.org/get-started/locally/ , I use conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia
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
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.
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/"
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
Same error happens.
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.
Unfortunately, there is still some time until the next release, and the only way to troubleshoot the issue now is through this way.
#240 I think the problem we encounter is the same. You can refer to it.
We have updated to the 0.6.2b1 release, addressing and resolving the aforementioned issue.
For anyone struggling. Top answer from here helped me: https://stackoverflow.com/a/76481449/4828157