mapillary / inplace_abn

In-Place Activated BatchNorm for Memory-Optimized Training of DNNs
BSD 3-Clause "New" or "Revised" License
1.32k stars 187 forks source link

Error installing python setup.py install #196

Open phongnhhn92 opened 3 years ago

phongnhhn92 commented 3 years ago

Hi, I am having this error installing your library. I am using CUDA 10.1and pytorch 1.7

image

running install
running bdist_egg
running egg_info
writing inplace_abn.egg-info/PKG-INFO
writing dependency_links to inplace_abn.egg-info/dependency_links.txt
writing top-level names to inplace_abn.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
writing manifest file 'inplace_abn.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying inplace_abn/_version.py -> build/lib.linux-x86_64-3.8/inplace_abn
running build_ext
building 'inplace_abn._backend' extension
Emitting ninja build file /home/phong/data/Work/Paper3/Archives/inplace_abn/build/temp.linux-x86_64-3.8/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/1] /usr/local/cuda/bin/nvcc -DWITH_CUDA=1 -I/home/phong/data/Work/Paper3/Archives/inplace_abn/include -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include/TH -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/phong/miniconda3/envs/deep/include/python3.8 -c -c /home/phong/data/Work/Paper3/Archives/inplace_abn/src/inplace_abn_cuda.cu -o /home/phong/data/Work/Paper3/Archives/inplace_abn/build/temp.linux-x86_64-3.8/src/inplace_abn_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_backend -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14
FAILED: /home/phong/data/Work/Paper3/Archives/inplace_abn/build/temp.linux-x86_64-3.8/src/inplace_abn_cuda.o 
/usr/local/cuda/bin/nvcc -DWITH_CUDA=1 -I/home/phong/data/Work/Paper3/Archives/inplace_abn/include -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include/TH -I/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/phong/miniconda3/envs/deep/include/python3.8 -c -c /home/phong/data/Work/Paper3/Archives/inplace_abn/src/inplace_abn_cuda.cu -o /home/phong/data/Work/Paper3/Archives/inplace_abn/build/temp.linux-x86_64-3.8/src/inplace_abn_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_backend -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14
/usr/include/c++/8/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/8/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/8/bits/basic_string.h:5052:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/8/bits/basic_string.h:5073:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char16_t*; _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’
/usr/include/c++/8/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/8/bits/basic_string.h:6725:95:   required from here
/usr/include/c++/8/bits/basic_string.tcc:1067:1: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char16_t; _Traits = std::char_traits<char16_t>; _Alloc = std::allocator<char16_t>]’ without object
       __p->_M_set_sharable();
 ^     ~~~~~~~~~
/usr/include/c++/8/bits/basic_string.tcc: In instantiation of ‘static std::basic_string<_CharT, _Traits, _Alloc>::_Rep* std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’:
/usr/include/c++/8/bits/basic_string.tcc:578:28:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&, std::forward_iterator_tag) [with _FwdIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/8/bits/basic_string.h:5052:20:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc&, std::__false_type) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/8/bits/basic_string.h:5073:24:   required from ‘static _CharT* std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with _InIterator = const char32_t*; _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’
/usr/include/c++/8/bits/basic_string.tcc:656:134:   required from ‘std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc&) [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>; std::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’
/usr/include/c++/8/bits/basic_string.h:6730:95:   required from here
/usr/include/c++/8/bits/basic_string.tcc:1067:1: error: cannot call member function ‘void std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_M_set_sharable() [with _CharT = char32_t; _Traits = std::char_traits<char32_t>; _Alloc = std::allocator<char32_t>]’ without object
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1516, in _run_ninja_build
    subprocess.run(
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/subprocess.py", line 512, 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 "setup.py", line 48, in <module>
    setuptools.setup(
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/__init__.py", line 163, in setup
    return distutils.core.setup(**attrs)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 175, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 161, in call_command
    self.run_command(cmdname)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/command/install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 87, in run
    _build_ext.run(self)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 653, in build_extensions
    build_ext.build_extensions(self)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 208, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension
    objects = self.compiler.compile(sources,
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 473, in unix_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1233, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "/home/phong/miniconda3/envs/deep/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1538, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
bsugerman commented 3 years ago

I'm using python 3.7 and had no problems.

stonewst commented 3 years ago

I have the same error. I use the python3.6

Traceback (most recent call last): File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1539, in _run_ninja_build env=env) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/subprocess.py", line 438, in run output=stdout, stderr=stderr) 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 "setup.py", line 74, in cmdclass={"build_ext": BuildExtension}, File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 164, in run cmd = self.call_command('install_lib', warn_dir=0) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command self.run_command(cmdname) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/command/install_lib.py", line 107, in build self.run_command('build_ext') File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run _build_ext.run(self) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 670, in build_extensions build_ext.build_extensions(self) File "/home/wusitong/anaconda3/envs/wstenvo/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/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions self._build_extensions_serial() File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial self.build_extension(ext) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 202, in build_extension _build_ext.build_extension(self, ext) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension depends=ext.depends) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 500, in unix_wrap_ninja_compile with_cuda=with_cuda) File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1255, in _write_ninja_file_and_compile_objects error_prefix='Error compiling objects for extension') File "/home/wusitong/anaconda3/envs/wstenvo/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1555, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error compiling objects for extension

YuhsiHu commented 1 year ago

Have you resolved it?