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’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

Closed
Ambuj-Choudha opened this issue Jun 26, 2023 · 5 comments

Comments

@Ambuj-Choudha
Copy link

Ambuj-Choudha commented Jun 26, 2023

  1. Terminal Output:
Obtaining file:///home/ambuj/Myprojects/detectron2
  Preparing metadata (setup.py) ... done
Requirement already satisfied: Pillow>=7.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (9.4.0)
Requirement already satisfied: matplotlib in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (3.7.1)
Requirement already satisfied: pycocotools>=2.0.2 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (2.0.6)
Requirement already satisfied: termcolor>=1.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (2.3.0)
Requirement already satisfied: yacs>=0.1.8 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (0.1.8)
Requirement already satisfied: tabulate in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (0.9.0)
Requirement already satisfied: cloudpickle in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (2.2.1)
Requirement already satisfied: tqdm>4.29.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (4.65.0)
Requirement already satisfied: tensorboard in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (2.13.0)
Requirement already satisfied: fvcore<0.1.6,>=0.1.5 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (0.1.5.post20221221)
Requirement already satisfied: iopath<0.1.10,>=0.1.7 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (0.1.9)
Requirement already satisfied: omegaconf>=2.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (2.3.0)
Requirement already satisfied: hydra-core>=1.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (1.3.2)
Requirement already satisfied: black in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (23.3.0)
Requirement already satisfied: packaging in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from detectron2==0.6) (23.1)
Requirement already satisfied: numpy in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from fvcore<0.1.6,>=0.1.5->detectron2==0.6) (1.25.0)
Requirement already satisfied: pyyaml>=5.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from fvcore<0.1.6,>=0.1.5->detectron2==0.6) (6.0)
Requirement already satisfied: antlr4-python3-runtime==4.9.* in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from hydra-core>=1.1->detectron2==0.6) (4.9.3)
Requirement already satisfied: portalocker in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from iopath<0.1.10,>=0.1.7->detectron2==0.6) (2.7.0)
Requirement already satisfied: contourpy>=1.0.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from matplotlib->detectron2==0.6) (1.1.0)
Requirement already satisfied: cycler>=0.10 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from matplotlib->detectron2==0.6) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from matplotlib->detectron2==0.6) (4.40.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from matplotlib->detectron2==0.6) (1.4.4)
Requirement already satisfied: pyparsing>=2.3.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from matplotlib->detectron2==0.6) (3.1.0)
Requirement already satisfied: python-dateutil>=2.7 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from matplotlib->detectron2==0.6) (2.8.2)
Requirement already satisfied: click>=8.0.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from black->detectron2==0.6) (8.1.3)
Requirement already satisfied: mypy-extensions>=0.4.3 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from black->detectron2==0.6) (1.0.0)
Requirement already satisfied: pathspec>=0.9.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from black->detectron2==0.6) (0.11.1)
Requirement already satisfied: platformdirs>=2 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from black->detectron2==0.6) (3.8.0)
Requirement already satisfied: absl-py>=0.4 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (1.4.0)
Requirement already satisfied: grpcio>=1.48.2 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (1.56.0)
Requirement already satisfied: google-auth<3,>=1.6.3 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (2.20.0)
Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (1.0.0)
Requirement already satisfied: markdown>=2.6.8 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (3.4.3)
Requirement already satisfied: protobuf>=3.19.6 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (4.23.3)
Requirement already satisfied: requests<3,>=2.21.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (2.29.0)
Requirement already satisfied: setuptools>=41.0.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (67.8.0)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (0.7.1)
Requirement already satisfied: werkzeug>=1.0.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (2.3.6)
Requirement already satisfied: wheel>=0.26 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from tensorboard->detectron2==0.6) (0.38.4)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->detectron2==0.6) (5.3.1)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->detectron2==0.6) (0.3.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->detectron2==0.6) (4.9)
Requirement already satisfied: six>=1.9.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->detectron2==0.6) (1.16.0)
Requirement already satisfied: urllib3<2.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from google-auth<3,>=1.6.3->tensorboard->detectron2==0.6) (1.26.16)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard->detectron2==0.6) (1.3.1)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.6) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.6) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.6) (2023.5.7)
Requirement already satisfied: MarkupSafe>=2.1.1 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from werkzeug>=1.0.1->tensorboard->detectron2==0.6) (2.1.1)
Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard->detectron2==0.6) (0.5.0)
Requirement already satisfied: oauthlib>=3.0.0 in /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard->detectron2==0.6) (3.2.2)
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
    ╰─> [119 lines of output]
        running develop
        /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
        !!
        
                ********************************************************************************
                Please avoid running ``setup.py`` and ``easy_install``.
                Instead, use pypa/build, pypa/installer, pypa/build or
                other standards-based tools.
        
                See https://github.com/pypa/setuptools/issues/917 for details.
                ********************************************************************************
        
        !!
          easy_install.initialize_options(self)
        /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
        !!
        
                ********************************************************************************
                Please avoid running ``setup.py`` directly.
                Instead, use pypa/build, pypa/installer, pypa/build or
                other standards-based tools.
        
                See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
                ********************************************************************************
        
        !!
          self.initialize_options()
        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/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/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/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
        FAILED: /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o
        c++ -MMD -MF /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
        In file included from /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp:2:0:
        /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.h:4:10: fatal error: pybind11/numpy.h: No such file or directory
         #include <pybind11/numpy.h>
                  ^~~~~~~~~~~~~~~~~~
        compilation terminated.
        [2/2] c++ -MMD -MF /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
        FAILED: /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o
        c++ -MMD -MF /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
        In file included from /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/python.h:11:0,
                         from /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/extension.h:6,
                         from /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.cpp:3:
        /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/Exceptions.h:14:10: fatal error: pybind11/pybind11.h: No such file or directory
         #include <pybind11/pybind11.h>
                  ^~~~~~~~~~~~~~~~~~~~~
        compilation terminated.
        ninja: build stopped: subcommand failed.
        Traceback (most recent call last):
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
            subprocess.run(
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/subprocess.py", line 571, 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 "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "/home/ambuj/Myprojects/detectron2/setup.py", line 151, in <module>
            setup(
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
            return distutils.core.setup(**attrs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
            return run_commands(dist)
                   ^^^^^^^^^^^^^^^^^^
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
            dist.run_commands()
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
            self.run_command(cmd)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
            super().run_command(command)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
            cmd_obj.run()
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/develop.py", line 34, in run
            self.install_for_development()
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/develop.py", line 115, in install_for_development
            self.run_command('build_ext')
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
            self.distribution.run_command(command)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
            super().run_command(command)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
            cmd_obj.run()
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 84, in run
            _build_ext.run(self)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
            self.build_extensions()
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions
            build_ext.build_extensions(self)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
            self._build_extensions_serial()
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
            self.build_extension(ext)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
            _build_ext.build_extension(self, ext)
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
            objects = self.compiler.compile(
                      ^^^^^^^^^^^^^^^^^^^^^^
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile
            _write_ninja_file_and_compile_objects(
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1574, in _write_ninja_file_and_compile_objects
            _run_ninja_build(
          File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1909, 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
╰─> [119 lines of output]
    running develop
    /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` and ``easy_install``.
            Instead, use pypa/build, pypa/installer, pypa/build or
            other standards-based tools.
    
            See https://github.com/pypa/setuptools/issues/917 for details.
            ********************************************************************************
    
    !!
      easy_install.initialize_options(self)
    /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer, pypa/build or
            other standards-based tools.
    
            See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
            ********************************************************************************
    
    !!
      self.initialize_options()
    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/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/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/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
    FAILED: /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o
    c++ -MMD -MF /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
    In file included from /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp:2:0:
    /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.h:4:10: fatal error: pybind11/numpy.h: No such file or directory
     #include <pybind11/numpy.h>
              ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    [2/2] c++ -MMD -MF /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
    FAILED: /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o
    c++ -MMD -MF /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/ambuj/anaconda3/envs/percepTree/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -O2 -isystem /home/ambuj/anaconda3/envs/percepTree/include -fPIC -I/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/TH -I/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/THC -I/home/ambuj/anaconda3/envs/percepTree/include/python3.11 -c -c /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.cpp -o /home/ambuj/Myprojects/detectron2/build/temp.linux-x86_64-cpython-311/home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
    In file included from /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/api/include/torch/python.h:11:0,
                     from /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/extension.h:6,
                     from /home/ambuj/Myprojects/detectron2/detectron2/layers/csrc/vision.cpp:3:
    /home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/include/torch/csrc/Exceptions.h:14:10: fatal error: pybind11/pybind11.h: No such file or directory
     #include <pybind11/pybind11.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
        subprocess.run(
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/subprocess.py", line 571, 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 "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/home/ambuj/Myprojects/detectron2/setup.py", line 151, in <module>
        setup(
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
        return distutils.core.setup(**attrs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
        return run_commands(dist)
               ^^^^^^^^^^^^^^^^^^
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
        dist.run_commands()
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
        self.run_command(cmd)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
        super().run_command(command)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/develop.py", line 115, in install_for_development
        self.run_command('build_ext')
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
        self.distribution.run_command(command)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/dist.py", line 1244, in run_command
        super().run_command(command)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.run()
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 84, in run
        _build_ext.run(self)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
        self.build_extensions()
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions
        build_ext.build_extensions(self)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
        self._build_extensions_serial()
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
        self.build_extension(ext)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
        _build_ext.build_extension(self, ext)
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
        objects = self.compiler.compile(
                  ^^^^^^^^^^^^^^^^^^^^^^
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile
        _write_ninja_file_and_compile_objects(
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1574, in _write_ninja_file_and_compile_objects
        _run_ninja_build(
      File "/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 1909, 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.
  1. What exact command you run:

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:

2023-06-26 10:02:15 URL:https://raw.githubusercontent.com/facebookresearch/detectron2/main/detectron2/utils/collect_env.py [8525/8525] -> "collect_env.py" [1]
/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torchvision/image.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
  warn(
-------------------------------  --------------------------------------------------------------------------------------
sys.platform                     linux
Python                           3.11.3 (main, May 15 2023, 15:45:52) [GCC 11.2.0]
numpy                            1.25.0
detectron2                       imported a wrong installation
detectron2._C                    not built correctly: No module named 'detectron2._C'
Compiler ($CXX)                  c++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
DETECTRON2_ENV_MODULE            <not set>
PyTorch                          2.0.1 @/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torch
PyTorch debug build              False
torch._C._GLIBCXX_USE_CXX11_ABI  True
GPU available                    No: torch.cuda.is_available() == False
Pillow                           9.4.0
torchvision                      0.15.2 @/home/ambuj/anaconda3/envs/percepTree/lib/python3.11/site-packages/torchvision
fvcore                           0.1.5.post20221221
iopath                           0.1.9
cv2                              4.6.0
-------------------------------  --------------------------------------------------------------------------------------
PyTorch built with:
  - GCC 11.2
  - C++ Version: 201703
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CXX_COMPILER=/croot/pytorch_1686931851744/_build_env/bin/x86_64-conda-linux-gnu-c++, CXX_FLAGS=-fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /croot/pytorch_1686931851744/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/include -fdebug-prefix-map=/croot/pytorch_1686931851744/work=/usr/local/src/conda/pytorch-2.0.1 -fdebug-prefix-map=/croot/pytorch_1686931851744/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold=/usr/local/src/conda-prefix -D_GLIBCXX_USE_CXX11_ABI=1 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=range-loop-construct -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -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=open, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_DISABLE_GPU_ASSERTS=ON, TORCH_VERSION=2.0.1, USE_CUDA=0, USE_CUDNN=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKLDNN=0, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, 
@Ambuj-Choudha Ambuj-Choudha changed the title Please read & provide the following RuntimeError: Error compiling objects for extension (installation issue - without CUDA) Jun 26, 2023
@satishjasthi
Copy link

Hi @Ambuj-Choudha

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.

  • Install pyenv from their repository. Its a great tool to maintain different python versions
  • Install python 3.11.3 version using pyenv
pyenv install 3.11.3
  • Set python 3.11.3 as python version for current terminal session using
pyenv shell 3.11.3
  • create a new virtual env using and activate it
python -m venv env && source ./env/bin/activate
  • check your python version and path using
python --version && which python
  • Now install torch and torch vision using pip
python -m pip install torch torchvision
  • I see that you already have GCC and G++ installed on your system and they are above v5 so you need not install them again
  • Next clone detectron repo using
git clone https://github.com/facebookresearch/detectron2.git
  • Install detectron2 using
python -m pip install -e detectron2

My Environment

-------------------------------  ---------------------------------------------------------------------------------------
sys.platform                     linux
Python                           3.11.3 (main, Jun 27 2023, 16:19:35) [GCC 11.3.0]
numpy                            1.25.0
detectron2                       0.6 @/home/***/Projects/OSP/detectron2/detectron2
Compiler                         GCC 11.3
CUDA compiler                    not available
DETECTRON2_ENV_MODULE            <not set>
PyTorch                          2.0.1+cu117 @/home/***/Projects/OSP/env/lib/python3.11/site-packages/torch
PyTorch debug build              False
torch._C._GLIBCXX_USE_CXX11_ABI  False
GPU available                    No: torch.cuda.is_available() == False
Pillow                           9.5.0
torchvision                      0.15.2+cu117 @/home/***/Projects/OSP/env/lib/python3.11/site-packages/torchvision
fvcore                           0.1.5.post20221221
iopath                           0.1.9
cv2                              4.7.0
-------------------------------  ---------------------------------------------------------------------------------------
PyTorch built with:
  - GCC 9.3
  - C++ Version: 201703
  - Intel(R) oneAPI Math Kernel Library Version 2022.2-Product Build 20220804 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.7.3 (Git Hash 6dbeffbae1f23cbbeae17adb7b5b13f1f37c080e)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.7, CUDNN_VERSION=8.5.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -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_DISABLE_GPU_ASSERTS=ON, TORCH_VERSION=2.0.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=1, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,

@Ambuj-Choudha
Copy link
Author

Ambuj-Choudha commented Jul 4, 2023

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!

@goodstudent9
Copy link

I have the same problems. Have you solved yet?

@Ambuj-Choudha
Copy link
Author

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.
This worked really great for me. Also, the testing /inference is rather faster on google colab than only CPU.

Currently, I am using the CUDA version (with GPU) rather than continuing on the CPU version or google colab.
I hope this helps! :)

@nondescriptpointer
Copy link

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.

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

4 participants