facebookresearch / facebookresearch/detectron2

Detectron2 installation error on Python 3.9

Open
#4,748 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
34.7k
Forks
7.9k
PR merge metrics
No merged PRs in 30d

Description

## Instructions To Reproduce the 🐛 Bug:
1. Full runnable code or full changes you made:
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._**
2. What exact command you run: python -m pip install -e detectron2 or python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
3. __Full logs__ or other relevant observations:
```
Installing collected packages: detectron2
Running setup.py develop for detectron2
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [94 lines of output]
running develop
/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
writing detectron2.egg-info/PKG-INFO
writing dependency_links to detectron2.egg-info/dependency_links.txt
writing requirements to detectron2.egg-info/requires.txt
writing top-level names to detectron2.egg-info/top_level.txt
reading manifest file 'detectron2.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'detectron2.egg-info/SOURCES.txt'
running build_ext
building 'detectron2._C' extension
Emitting ninja build file /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
FAILED: /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o
c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
In file included from /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp:2:
/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.h:4:10: fatal error: pybind11/numpy.h: No such file or directory
4 | #include
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
[2/2] c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
FAILED: /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o
c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
In file included from /home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/python.h:12,
from /home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/extension.h:6,
from /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.cpp:3:
/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/utils/pybind.h:7:10: fatal error: pybind11/pybind11.h: No such file or directory
7 | #include
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1813, in _run_ninja_build
subprocess.run(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/home/edib_hamza/projects/detectron2/setup.py", line 148, in
setup(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run
self.install_for_development()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development
self.run_command('build_ext')
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
self.build_extensions()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 770, in build_extensions
build_ext.build_extensions(self)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
self._build_extensions_serial()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
self.build_extension(ext)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
_build_ext.build_extension(self, ext)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 549, in build_extension
objects = self.compiler.compile(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 591, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1492, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1829, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [94 lines of output]
running develop
/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running egg_info
writing detectron2.egg-info/PKG-INFO
writing dependency_links to detectron2.egg-info/dependency_links.txt
writing requirements to detectron2.egg-info/requires.txt
writing top-level names to detectron2.egg-info/top_level.txt
reading manifest file 'detectron2.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'detectron2.egg-info/SOURCES.txt'
running build_ext
building 'detectron2._C' extension
Emitting ninja build file /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
FAILED: /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o
c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
In file included from /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp:2:
/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.h:4:10: fatal error: pybind11/numpy.h: No such file or directory
4 | #include
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
[2/2] c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
FAILED: /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o
c++ -MMD -MF /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/edib_hamza/anaconda3/envs/pytorch3d/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -O2 -isystem /home/edib_hamza/anaconda3/envs/pytorch3d/include -fPIC -DWITH_CUDA -I/home/edib_hamza/projects/detectron2/detectron2/layers/csrc -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/TH -I/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/edib_hamza/anaconda3/envs/pytorch3d/include/python3.9 -c -c /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/edib_hamza/projects/detectron2/build/temp.linux-x86_64-cpython-39/home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1013"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
In file included from /home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/api/include/torch/python.h:12,
from /home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/extension.h:6,
from /home/edib_hamza/projects/detectron2/detectron2/layers/csrc/vision.cpp:3:
/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/include/torch/csrc/utils/pybind.h:7:10: fatal error: pybind11/pybind11.h: No such file or directory
7 | #include
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1813, in _run_ninja_build
subprocess.run(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/home/edib_hamza/projects/detectron2/setup.py", line 148, in
setup(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run
self.install_for_development()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development
self.run_command('build_ext')
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
self.build_extensions()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 770, in build_extensions
build_ext.build_extensions(self)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
self._build_extensions_serial()
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
self.build_extension(ext)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
_build_ext.build_extension(self, ext)
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 549, in build_extension
objects = self.compiler.compile(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 591, in unix_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1492, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1829, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
```

## Environment:

Provide your environment information using the following command:
```
cuobjdump info : File '/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torchvision/_C.so' does not contain device code
---------------------- -------------------------------------------------------------------------------------------
sys.platform linux
Python 3.9.16 (main, Jan 11 2023, 16:05:54) [GCC 11.2.0]
numpy 1.23.5
detectron2 imported a wrong installation
detectron2._C not built correctly: No module named 'detectron2._C'
Compiler ($CXX) c++ (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
CUDA compiler Build cuda_11.3.r11.3/compiler.29745058_0
DETECTRON2_ENV_MODULE
PyTorch 1.12.1 @/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torch
PyTorch debug build False
GPU available Yes
GPU 0 NVIDIA GeForce GTX 1050 Ti (arch=6.1)
Driver version 510.85.02
CUDA_HOME /usr/local/cuda-11.3
Pillow 9.3.0
torchvision 0.13.1a0 @/home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torchvision
torchvision arch flags /home/edib_hamza/anaconda3/envs/pytorch3d/lib/python3.9/site-packages/torchvision/_C.so
fvcore 0.1.5.post20221221
iopath 0.1.9
cv2 4.7.0
---------------------- -------------------------------------------------------------------------------------------
PyTorch built with:
- GCC 9.3
- C++ Version: 201402
- Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v2.6.0 (Git Hash N/A)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: AVX2
- CUDA Runtime 11.3
- NVCC architecture flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_86,code=compute_86
- CuDNN 8.2.1
- Magma 2.7.0
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.1, CXX_COMPILER=/home/builder/mc3/envs/pytorch-build/envs/pytorch-build/conda-bld/pytorch_1673601922403/_build_env/bin/x86_64-conda-linux-gnu-c++, CXX_FLAGS=-fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/builder/mc3/envs/pytorch-build/envs/pytorch-build/conda-bld/pytorch_1673601922403/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/include -fdebug-prefix-map=/home/builder/mc3/envs/pytorch-build/envs/pytorch-build/conda-bld/pytorch_1673601922403/work=/usr/local/src/conda/pytorch-1.12.1 -fdebug-prefix-map=/home/builder/mc3/envs/pytorch-build/envs/pytorch-build/conda-bld/pytorch_1673601922403/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_=/usr/local/src/conda-prefix -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.12.1, USE_CUDA=1, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,
```

Contributor guide

Open the contributing guide

Research direction

Start with setup.py around line 148 and reproduce the reported pip installation commands in a Python 3.9 environment. Inspect the native extension build configuration and the logged missing pybind11 headers, then compare it with the working Python 3.8 environment. Done means the reported installation succeeds or the supported dependency requirements are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.