RuntimeError: Error compiling objects for extension
See original GitHub issueGetting error on running this python setup.py develop
`(fashion) aaradhya@aaradhya:~/repo/mmfashion/mm-detection-v1.2$ python setup.py develop running develop running egg_info writing mmdet.egg-info/PKG-INFO writing dependency_links to mmdet.egg-info/dependency_links.txt writing requirements to mmdet.egg-info/requires.txt writing top-level names to mmdet.egg-info/top_level.txt reading manifest file ‘mmdet.egg-info/SOURCES.txt’ writing manifest file ‘mmdet.egg-info/SOURCES.txt’ running build_ext building ‘mmdet.ops.nms.nms_cuda’ extension Emitting ninja build file /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/build.ninja… Compiling objects… Allowing ninja to set a default number of workers… (overridable by setting the environment variable MAX_JOBS=N) [1/2] /usr/local/cuda-8.0/bin/nvcc -DWITH_CUDA -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/TH -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/aaradhya/anaconda2/envs/fashion/include/python3.6m -c -c /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_kernel.cu -o /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ‘’“'”‘-fPIC’“'”‘’ -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_50,code=sm_50 -std=c++14 FAILED: /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_kernel.o /usr/local/cuda-8.0/bin/nvcc -DWITH_CUDA -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/TH -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/aaradhya/anaconda2/envs/fashion/include/python3.6m -c -c /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_kernel.cu -o /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ‘’“'”‘-fPIC’“'”‘’ -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_50,code=sm_50 -std=c++14 nvcc fatal : Value ‘c++14’ is not defined for option ‘std’ [2/2] c++ -MMD -MF /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_cuda.o.d -pthread -B /home/aaradhya/anaconda2/envs/fashion/compiler_compat -Wl,–sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/TH -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/aaradhya/anaconda2/envs/fashion/include/python3.6m -c -c /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp -o /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 FAILED: /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_cuda.o c++ -MMD -MF /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_cuda.o.d -pthread -B /home/aaradhya/anaconda2/envs/fashion/compiler_compat -Wl,–sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/TH -I/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-8.0/include -I/home/aaradhya/anaconda2/envs/fashion/include/python3.6m -c -c /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp -o /home/aaradhya/repo/mmfashion/mm-detection-v1.2/build/temp.linux-x86_64-3.6/mmdet/ops/nms/src/nms_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp: In function ‘at::Tensor nms(const at::Tensor&, float)’: /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp:4:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations] #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") ^ /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp:9:3: note: in expansion of macro ‘CHECK_CUDA’ CHECK_CUDA(dets); ^ In file included from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:11:0, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/ATen/Context.h:4, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/ATen/ATen.h:5, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4, from /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/torch/extension.h:4, from /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp:2: /home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:262:30: note: declared here DeprecatedTypeProperties & type() const { ^ /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp:4:80: error: ‘AT_CHECK’ was not declared in this scope #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") ^ /home/aaradhya/repo/mmfashion/mm-detection-v1.2/mmdet/ops/nms/src/nms_cuda.cpp:9:3: note: in expansion of macro ‘CHECK_CUDA’ CHECK_CUDA(dets); ^ ninja: build stopped: subcommand failed. Traceback (most recent call last): File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 1423, in _run_ninja_build check=True) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/subprocess.py”, line 438, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “setup.py”, line 297, in <module> zip_safe=False) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/setuptools/init.py”, line 165, in setup return distutils.core.setup(**attrs) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/core.py”, line 148, in setup dist.run_commands() File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/dist.py”, line 955, in run_commands self.run_command(cmd) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/dist.py”, line 974, in run_command cmd_obj.run() File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/setuptools/command/develop.py”, line 38, in run self.install_for_development() File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/setuptools/command/develop.py”, line 140, in install_for_development self.run_command(‘build_ext’) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/cmd.py”, line 313, in run_command self.distribution.run_command(command) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/dist.py”, line 974, in run_command cmd_obj.run() File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/setuptools/command/build_ext.py”, line 87, in run _build_ext.run(self) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py”, line 186, in run _build_ext.build_ext.run(self) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/command/build_ext.py”, line 339, in run self.build_extensions() File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 603, in build_extensions build_ext.build_extensions(self) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py”, line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/command/build_ext.py”, line 448, in build_extensions self._build_extensions_serial() File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/command/build_ext.py”, line 473, in _build_extensions_serial self.build_extension(ext) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/setuptools/command/build_ext.py”, line 208, in build_extension _build_ext.build_extension(self, ext) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/distutils/command/build_ext.py”, line 533, in build_extension depends=ext.depends) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 437, in unix_wrap_ninja_compile with_cuda=with_cuda) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 1163, in _write_ninja_file_and_compile_objects error_prefix=‘Error compiling objects for extension’) File “/home/aaradhya/anaconda2/envs/fashion/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 1436, in _run_ninja_build raise RuntimeError(message) RuntimeError: Error compiling objects for extension ` Checklist
- I have searched related issues but cannot get the expected help.
- The bug has not been fixed in the latest version. >> I want to use v1.2 because that version is used for mm fashion
Describe the bug A clear and concise description of what the bug is.
Reproduction
- What command or script did you run?
python setup.py develop
- Did you make any modifications on the code or config? Did you understand what you have modified? No
- What dataset did you use? Not applicable
Environment
- Please run
python mmdet/utils/collect_env.pyto collect necessary environment information and paste it here. Can’t do this because error is happening while installing the library itself. - You may add addition that may be helpful for locating the problem, such as
- Installed PyTorch using pip
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Related StackOverflow Question
For reference,
‘AT_CHECK’is removed in newer versions of PyTorch. See https://github.com/open-mmlab/mmdetection/issues/22, and https://github.com/pytorch/pytorch/pull/34846 .Thx, change the
AT_CHECKtoTORCH_CHECKcould solve this problem.