-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: Error compiling objects for extension (installation issue - without CUDA) #5009
Comments
There seems to be an issue with your PyTorch installation. You can follow these steps to install detectron2 within your environment constraints(like python 3.11.3 and linux platform). Within same Environment as yours I was able to install detectron2 successfully. I have shared my Environment at the end of this comment. I hope this resolves your issue, if you face any further issue even after following these steps, let me know.
pyenv install 3.11.3
pyenv shell 3.11.3
python -m venv env && source ./env/bin/activate
python --version && which python
python -m pip install torch torchvision
git clone https://github.com/facebookresearch/detectron2.git
python -m pip install -e detectron2 My Environment
|
Thanks a lot! @satishjasthi More importantly, I see you have directly installed detectron2 on your system after pytorch installation, as openCV is an optional dependency. But I would like to highlight the fact that the reason why my pytorch version got messed up was because that I installed openCV right after installing torch, and the openCV package has different version requirement than detectron2, and it kinda SUPERSEDED, and a different version of pytorch (particularly torchvision) got installed. Thank you very much for the help! |
I have the same problems. Have you solved yet? |
Hey hi @goodstudent9 , I actually switched to the google colab as there aren't issues with the detectron2 installation. I would suggest you to do the same, upload your data as a .zip file on the gdrive and then you can mount your gdrive on the google colab notebook. Currently, I am using the CUDA version (with GPU) rather than continuing on the CPU version or google colab. |
Having CUDA mismatches can cause the installer to fail. This can be solved by first installing CPU torch, installing detectron and then uninstalling CPU torch and installing CUDA torch. Detectron often works even though there is a CUDA mismatch between for example 12.1-12.4. Probably wont work for all mismatches. |
after installing pyTorch and openCV. I cloned the git repo for detectron2 and then ran the following command.
Followed all the instructions for installing the dependencies correctly.
python -m pip install -e detectron2
Expected behavior:
the package should get installed
Environment:
The text was updated successfully, but these errors were encountered: