MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
8.05k stars 1.98k forks source link

setup error with 'RuntimeError: Error compiling objects for extension' #1184

Open Xijieupenn opened 1 year ago

Xijieupenn commented 1 year ago

I am running the setup.py with cuda11.3, pytorch 1.11. It gives me error as below. Running 'gcc --version' gives 8.4.0.

/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/init.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. !!

    ********************************************************************************
    Requirements should be satisfied by a PEP 517 installer.
    If you are using pip, you can try `pip install --use-pep517`.
    ********************************************************************************

!! dist.fetch_build_eggs(dist.setup_requires) running build running build_py copying alphapose/version.py -> build/lib.linux-x86_64-cpython-38/alphapose running build_ext building 'detector.nms.soft_nms_cpu' extension Emitting ninja build file /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) ninja: no work to do. g++ -pthread -shared -B /home/xijie/miniconda3/envs/alphapose/compiler_compat -L/home/xijie/miniconda3/envs/alphapose/lib -Wl,-rpath=/home/xijie/miniconda3/envs/alphapose/lib -Wl,--no-as-needed -Wl,--sysroot=/ /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/soft_nms_cpu.o -o build/lib.linux-x86_64-cpython-38/detector/nms/soft_nms_cpu.cpython-38-x86_64-linux-gnu.so building 'detector.nms.nms_cpu' extension Emitting ninja build file /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/1] g++ -MMD -MF /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_cpu.o.d -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/TH -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/xijie/miniconda3/envs/alphapose/include/python3.8 -c -c /home/xijie/Documents/master_thesis/AlphaPose/detector/nms/src/nms_cpu.cpp -o /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=nms_cpu -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++ g++ -pthread -shared -B /home/xijie/miniconda3/envs/alphapose/compiler_compat -L/home/xijie/miniconda3/envs/alphapose/lib -Wl,-rpath=/home/xijie/miniconda3/envs/alphapose/lib -Wl,--no-as-needed -Wl,--sysroot=/ /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_cpu.o -L/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/lib -L/usr/local/cuda-11.3/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda_cu -ltorch_cuda_cpp -o build/lib.linux-x86_64-cpython-38/detector/nms/nms_cpu.cpython-38-x86_64-linux-gnu.so building 'detector.nms.nms_cuda' extension Emitting ninja build file /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/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-11.3/bin/nvcc -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/TH -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/xijie/miniconda3/envs/alphapose/include/python3.8 -c -c /home/xijie/Documents/master_thesis/AlphaPose/detector/nms/src/nms_kernel.cu -o /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=nms_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -ccbin /usr/bin/clang-11 -std=c++14 FAILED: /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_kernel.o /usr/local/cuda-11.3/bin/nvcc -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/TH -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/xijie/miniconda3/envs/alphapose/include/python3.8 -c -c /home/xijie/Documents/master_thesis/AlphaPose/detector/nms/src/nms_kernel.cu -o /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=nms_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -ccbin /usr/bin/clang-11 -std=c++14 /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(70): error: qualified name is not allowed

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(72): error: expected a "("

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(72): error: expected a type specifier

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(72): error: expected a ")"

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(76): error: expected a "("

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(76): error: expected a type specifier

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(77): error: expected a ";"

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(78): error: expected a "("

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(78): error: expected a ";"

/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/numeric_traits.h(88): error: class template "gnu_cxx::__numeric_traits_integer<_Value>" has no member "is_signed"

10 errors detected in the compilation of "/home/xijie/Documents/master_thesis/AlphaPose/detector/nms/src/nms_kernel.cu". [2/2] g++ -MMD -MF /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_cuda.o.d -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/TH -I/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/xijie/miniconda3/envs/alphapose/include/python3.8 -c -c /home/xijie/Documents/master_thesis/AlphaPose/detector/nms/src/nms_cuda.cpp -o /home/xijie/Documents/master_thesis/AlphaPose/build/temp.linux-x86_64-cpython-38/detector/nms/src/nms_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -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++ ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1740, in _run_ninja_build subprocess.run( File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/subprocess.py", line 516, 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 187, in setup( File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/init.py", line 107, in setup return distutils.core.setup(**attrs) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command super().run_command(command) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run self.run_command(cmd_name) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command super().run_command(command) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run _build_ext.run(self) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run self.build_extensions() File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 741, in build_extensions build_ext.build_extensions(self) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions self._build_extensions_serial() File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial self.build_extension(ext) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 246, in build_extension _build_ext.build_extension(self, ext) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension super(build_ext, self).build_extension(ext) File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension objects = self.compiler.compile( File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 562, in unix_wrap_ninja_compile _write_ninja_file_and_compile_objects( File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1419, in _write_ninja_file_and_compile_objects _run_ninja_build( File "/home/xijie/miniconda3/envs/alphapose/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1756, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error compiling objects for extension

Sh1n1ma commented 1 year ago

请问一下您解决了吗

anas-zafar commented 11 months ago

@Sh1n1ma @Xijieupenn were you able to solve this?

Sh1n1ma commented 11 months ago

@Sh1n1ma @Xijieupenn were you able to solve this?

I just redownloaded the code and reinstalled it according to the readme document.And then it was okay. python 3.8.18 torch 1.12.0+cu113 torchaudio 0.12.0+cu113 torchvision 0.13.0+cu113