-
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
Detectron2 installation error on Python 3.9 #4748
Comments
Hey, I created new env with python=3.8.5 but I didn't fix it. Before install detectron2, I installed this packages:
After that I am running this command "python -m pip install 'git+https://github.com/facebookresearch/detectron2.git' " |
|
Thank you, pybind was the culprit 👍 |
This really helps. Thanks a lot. |
same issue remains on windows 10, even after installing pybind |
-- 2023.12.19 16:00:00 -- -- update on 2023.12.20 10.13 -- |
I faced the same issue while installing In summary, run the following: |
For me it also worked to install pybind11 and pybind11-global in my conda environment: |
Solved on Windows with python=3.9 torch=2.1 cuda=11.8
The problem is, that the detectron2 build script looks for "pybind11/pybind11.h" in your env/include directory. The latest version of pybind11 however installs this intermediate directory named "pybind11_global". |
I found extremely tricky to get all the dependencies right. # Create conda env
conda create --name detectron2 python==3.9 -y
conda activate matcher
# Install torch
pip install torch torchvision
# Install gcc and g++ with conda
conda install -c conda-forge pybind11
conda install -c conda-forge gxx
conda install -c anaconda gcc_linux-64
conda upgrade -c conda-forge --all
# Install detectron2 (specific version)
pip install 'git+https://github.com/facebookresearch/[email protected]' |
you need to install:
and then try to install the detectron2. It worked for me. |
Instructions To Reproduce the 🐛 Bug:
I didn't change anything. I have another conda enviroment in my machine, and I successfully installed detectron2 on this enviroment, the only difference is that this enviroment is using python 3.8.
Environment:
Provide your environment information using the following command:
The text was updated successfully, but these errors were encountered: