researchmm / TracKit

[ECCV'20] Ocean: Object-aware Anchor-Free Tracking
MIT License
610 stars 98 forks source link

[Environment setup issue] ninja: build stopped: subcommand failed. #36

Closed sandeepnmenon closed 3 years ago

sandeepnmenon commented 3 years ago

I am setting up the environment as mentioned in the documentation. I was able to successfully run the following steps

cd $TracKit/lib/tutorial
bash install.sh $conda_path TracKit
cd $TracKit
conda activate TracKit

But failing on python setup.py develop

Environment details Python 3.7.9 [GCC 7.3.0] :: Anaconda, Inc. on linux Cuda: 10.2 Graphics card: GeForce GTX TITAN X OS: Ubuntu 18.04 LTS

The complete error is as follows.

(TracKit) deepen@deepen-Z11PA-U12-Series:~/SandeepMenon/TracKit$ python setup.py develop
/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/setuptools/dist.py:452: UserWarning: Normalizing '1.0.rc0' to '1.0rc0'
  warnings.warn(tmpl.format(**locals()))
running develop
running egg_info
writing mmdet.egg-info/PKG-INFO
writing dependency_links to mmdet.egg-info/dependency_links.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 'lib.models.dcn.deform_conv_cuda' extension
Emitting ninja build file /home/deepen/SandeepMenon/TracKit/build/temp.linux-x86_64-3.7/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/1] c++ -MMD -MF /home/deepen/SandeepMenon/TracKit/build/temp.linux-x86_64-3.7/lib/models/dcn/src/deform_conv_cuda.o.d -pthread -B /home/deepen/anaconda3/envs/TracKit/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/deepen/.local/lib/python3.7/site-packages/torch/include -I/home/deepen/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/deepen/.local/lib/python3.7/site-packages/torch/include/TH -I/home/deepen/.local/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/deepen/anaconda3/envs/TracKit/include/python3.7m -c -c /home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp -o /home/deepen/SandeepMenon/TracKit/build/temp.linux-x86_64-3.7/lib/models/dcn/src/deform_conv_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=deform_conv_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /home/deepen/SandeepMenon/TracKit/build/temp.linux-x86_64-3.7/lib/models/dcn/src/deform_conv_cuda.o 
c++ -MMD -MF /home/deepen/SandeepMenon/TracKit/build/temp.linux-x86_64-3.7/lib/models/dcn/src/deform_conv_cuda.o.d -pthread -B /home/deepen/anaconda3/envs/TracKit/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/deepen/.local/lib/python3.7/site-packages/torch/include -I/home/deepen/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/deepen/.local/lib/python3.7/site-packages/torch/include/TH -I/home/deepen/.local/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/deepen/anaconda3/envs/TracKit/include/python3.7m -c -c /home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp -o /home/deepen/SandeepMenon/TracKit/build/temp.linux-x86_64-3.7/lib/models/dcn/src/deform_conv_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=deform_conv_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/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp: In function ‘void shape_check(at::Tensor, at::Tensor, at::Tensor*, at::Tensor, int, int, int, int, int, int, int, int, int, int)’:
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:63:3: error: ‘AT_CHECK’ was not declared in this scope
   AT_CHECK(weight.ndimension() == 4,
   ^~~~~~~~
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:63:3: note: suggested alternative: ‘DCHECK’
   AT_CHECK(weight.ndimension() == 4,
   ^~~~~~~~
   DCHECK
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp: In function ‘int deform_conv_forward_cuda(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int, int)’:
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:190:3: error: ‘AT_CHECK’ was not declared in this scope
   AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset");
   ^~~~~~~~
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:190:3: note: suggested alternative: ‘DCHECK’
   AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset");
   ^~~~~~~~
   DCHECK
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp: In function ‘int deform_conv_backward_input_cuda(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int, int)’:
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:296:3: error: ‘AT_CHECK’ was not declared in this scope
   AT_CHECK((offset.size(0) == batchSize), 3, "invalid batch size of offset");
   ^~~~~~~~
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:296:3: note: suggested alternative: ‘DCHECK’
   AT_CHECK((offset.size(0) == batchSize), 3, "invalid batch size of offset");
   ^~~~~~~~
   DCHECK
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp: In function ‘int deform_conv_backward_parameters_cuda(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int, float, int)’:
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:411:3: error: ‘AT_CHECK’ was not declared in this scope
   AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset");
   ^~~~~~~~
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:411:3: note: suggested alternative: ‘DCHECK’
   AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset");
   ^~~~~~~~
   DCHECK
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp: In function ‘void modulated_deform_conv_cuda_forward(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int, bool)’:
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:491:3: error: ‘AT_CHECK’ was not declared in this scope
   AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous");
   ^~~~~~~~
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:491:3: note: suggested alternative: ‘DCHECK’
   AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous");
   ^~~~~~~~
   DCHECK
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp: In function ‘void modulated_deform_conv_cuda_backward(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, int, int, int, int, int, int, int, int, int, int, bool)’:
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:572:3: error: ‘AT_CHECK’ was not declared in this scope
   AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous");
   ^~~~~~~~
/home/deepen/SandeepMenon/TracKit/lib/models/dcn/src/deform_conv_cuda.cpp:572:3: note: suggested alternative: ‘DCHECK’
   AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous");
   ^~~~~~~~
   DCHECK
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/deepen/.local/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1400, in _run_ninja_build
    check=True)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/subprocess.py", line 512, 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 174, in <module>
    zip_safe=False)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/setuptools/command/develop.py", line 136, in install_for_development
    self.run_command('build_ext')
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/deepen/.local/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 580, in build_extensions
    build_ext.build_extensions(self)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/deepen/anaconda3/envs/TracKit/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "/home/deepen/.local/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 423, in unix_wrap_ninja_compile
    with_cuda=with_cuda)
  File "/home/deepen/.local/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects
    error_prefix='Error compiling objects for extension')
  File "/home/deepen/.local/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1413, in _run_ninja_build
    raise RuntimeError(message)
RuntimeError: Error compiling objects for extension

Am I missing something? Any help is appreciated. Thank you

partus commented 3 years ago

sed -i 's/AT_CHECK/TORCH_CHECK/g' lib/models/dcn/src/deform*

interflow-miao commented 3 years ago

I ran into the same problem,may i know how did you solve it? Any help is appreciated. Thank you

sandeepnmenon commented 3 years ago

I ran into the same problem,may i know how did you solve it? Any help is appreciated. Thank you

I could not get it working in the environment setup mentioned in the issue. But got it working inside a docker container

FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
RUN apt install -y python3
RUN apt install -y python3-pip
RUN python3 -m pip install --upgrade pip 

RUN python3 -m pip install torch==1.1.0 torchvision==0.3.0

RUN apt install -y git
RUN git clone https://github.com/researchmm/TracKit.git
RUN cd /opt/docker/TracKit && python3 setup.py develop
interflow-miao commented 3 years ago

I ran into the same problem,may i know how did you solve it? Any help is appreciated. Thank you

I could not get it working in the environment setup mentioned in the issue. But got it working inside a docker container

FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04
RUN apt install -y python3
RUN apt install -y python3-pip
RUN python3 -m pip install --upgrade pip 

RUN python3 -m pip install torch==1.1.0 torchvision==0.3.0

RUN apt install -y git
RUN git clone https://github.com/researchmm/TracKit.git
RUN cd /opt/docker/TracKit && python3 setup.py develop

okay,i will have a try,thank you so much!