RuntimeError: Error compiling objects for extension

See original GitHub issue

Getting 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

  1. I have searched related issues but cannot get the expected help.
  2. 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

  1. What command or script did you run?
python setup.py develop
  1. Did you make any modifications on the code or config? Did you understand what you have modified? No
  2. What dataset did you use? Not applicable

Environment

  1. Please run python mmdet/utils/collect_env.py to collect necessary environment information and paste it here. Can’t do this because error is happening while installing the library itself.
  2. You may add addition that may be helpful for locating the problem, such as
    • Installed PyTorch using pip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
liaopeiyuancommented, Jul 23, 2020

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 .

1reaction
zhanghm1995commented, Mar 22, 2021

For reference, ‘AT_CHECK’ is removed in newer versions of PyTorch. See #22, and pytorch/pytorch#34846 .

Thx, change the AT_CHECK to TORCH_CHECK could solve this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: Error compiling objects for extension #1236
When I execute the above command, I get an error. why. running on google colab.
Read more >
RuntimeError: Error compiling objects for extension while ...
I just finished installing the tensorflow object detection API so I have pycocotools and other c++ build tools required. Are there more ...
Read more >
Error compiling objects for extension手把手带你解决(超详细)
2、找到对应自己pytorch版本的cuda,比如我的有cuda、cuda-11.3、cuda-11.6,但是我的pytorch对应的是cuda(我把cuda11.1命名为cuda了)。
Read more >
mmdetection3D RuntimeError: Error compiling objects for ...
最近在配置open-mmlab的mmdetection3d项目,其中大部分的步骤都可以很方便的完成,但是在CUDA版本和torch版本上会有一定的问题,详细记录下:.
Read more >
How to install - Annolid Documentation
On Windows, if you encounter errors for pycocotools, please download and ... raise RuntimeError(message) RuntimeError: Error compiling objects for extension ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found