Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wheels for torch 2.0 #4901

Open
23pointsNorth opened this issue Apr 7, 2023 · 10 comments
Open

Wheels for torch 2.0 #4901

23pointsNorth opened this issue Apr 7, 2023 · 10 comments

Comments

@23pointsNorth
Copy link

Instructions To Reproduce the 馃悰 Bug:

  1. Full runnable code or full changes you made:

Running the Colab demo for Detic - https://colab.research.google.com/drive/1QtTW9-ukX2HKZGvt0QvVGqjuqEykoZKI#scrollTo=S7MpTaZ0YNTb

results with an error as pytorch 2.0 is not part of the pre-build wheels - https://detectron2.readthedocs.io/en/latest/tutorials/install.html#install-pre-built-detectron2-linux-only

  1. Full logs or other relevant observations:
torch:  2.0 ; cuda:  cu118
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Looking in links: https://dl.fbaipublicfiles.com/detectron2/wheels/cu118/torch2.0/index.html
ERROR: Could not find a version that satisfies the requirement detectron2 (from versions: none)
ERROR: No matching distribution found for detectron2
@KingAlejandro
Copy link

KingAlejandro commented Apr 11, 2023

It would be useful to have the wheels for newer versions of torch. It seems like they haven't been updated since November 2021. I am using the more limited installation method for now:

!git clone 'https://github.com/facebookresearch/detectron2'
dist = distutils.core.run_setup("./detectron2/setup.py")
!python -m pip install {' '.join([f"'{x}'" for x in dist.install_requires])}
sys.path.insert(0, os.path.abspath('./detectron2'))

It seems to work fine for me so far on torch 2.0 and CUDA 1.18.

@23pointsNorth
Copy link
Author

Of course the option of !python -m pip install 'git+https://github.com/facebookresearch/detectron2.git@v0.6' is still there, but having a clean install would have been better :)

@johnnynunez
Copy link

Of course the option of !python -m pip install 'git+https://github.com/facebookresearch/detectron2.git@v0.6' is still there, but having a clean install would have been better :)

#4868

@hangzhiyiwei
Copy link

Hi,

I use Python 3.8, PyTorch 2.0, and Cuda 12.1 in Ubuntu 20.04, but I still face the compiling problem as follows.

RuntimeError:
The detected CUDA version (12.1) mismatches the version that was used to compile
PyTorch (11.8). Please make sure to use the same CUDA versions.

Actually, the Pytorch can be used in my virtual environment. I don't know how to solve the problem. Any reply will be appreciated, thank you.

@johnnynunez
Copy link

johnnynunez commented May 4, 2023

Hi,

I use Python 3.8, PyTorch 2.0, and Cuda 12.1 in Ubuntu 20.04, but I still face the compiling problem as follows.

RuntimeError: The detected CUDA version (12.1) mismatches the version that was used to compile PyTorch (11.8). Please make sure to use the same CUDA versions.

Actually, the Pytorch can be used in my virtual environment. I don't know how to solve the problem. Any reply will be appreciated, thank you.

you should use pytorch nightly that comes with cuda 12.1:

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121

In any case, my wheels upload in CircleCI and Github actions

@hangzhiyiwei
Copy link

Oh, thank you for your reply. It works now!

@ApacheNaren
Copy link

@johnnynunez, can you help me out to find your wheel for the detectron2..?

@johndpope
Copy link

@ApacheNaren doesn't look like the release is for cuda 12.1

Screenshot from 2023-12-02 06-50-20

Not sure it helps anyone -
was running into this problem.

  File "/home/oem/miniconda3/envs/torch2/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 387, in _check_cuda_version
    raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
RuntimeError: 
The detected CUDA version (12.1) mismatches the version that was used to compile

I have multiple cuda installations

cd /usr/local 
open .

Screenshot from 2023-12-02 06-55-12

my .zshrc looks like this

export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.1/include
export PATH="/usr/local/cuda-12.1/bin:$PATH"
export CUDA_HOME="/usr/local/cuda-12.1"

I just specify 11.8 here (as it exists on my system) then just paste in terminal

export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.8/include
export PATH="/usr/local/cuda-11.8/bin:$PATH"
export CUDA_HOME="/usr/local/cuda-11.8"

then the build succeeds.

@johnnynunez
Copy link

@ApacheNaren doesn't look like the release is for cuda 12.1

Screenshot from 2023-12-02 06-50-20

Not sure it helps anyone -

was running into this problem.


  File "/home/oem/miniconda3/envs/torch2/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 387, in _check_cuda_version

    raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))

RuntimeError: 

The detected CUDA version (12.1) mismatches the version that was used to compile



I have multiple cuda installations

cd /usr/local 

open .

Screenshot from 2023-12-02 06-55-12

my .zshrc looks like this


export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.1/include

export PATH="/usr/local/cuda-12.1/bin:$PATH"

export CUDA_HOME="/usr/local/cuda-12.1"

I just specify 11.8 here (as it exists on my system) then just paste in terminal


export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.8/include

export PATH="/usr/local/cuda-11.8/bin:$PATH"

export CUDA_HOME="/usr/local/cuda-11.8"

then the build succeeds.

In my branch, if you look on artifact, you will found .whl compiled with cuda 12.1

@MiroPsota
Copy link

As an alternative, you can try my repository for building packages and PyPI simple index and see if it works for you:
#5200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants