haofeixu / aanet

[CVPR'20] AANet: Adaptive Aggregation Network for Efficient Stereo Matching
Apache License 2.0
524 stars 102 forks source link

Failed build deform_conv #26

Closed sunshinnnn closed 4 years ago

sunshinnnn commented 4 years ago

Hi, I meet error when compile deform_conv, is there any suggestions to solve it?

➜ deform_conv bash build.sh
running build_ext /home/vrlab/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py:305: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) building 'deform_conv_cuda' extension creating build creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/src gcc -pthread -B /home/vrlab/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/vrlab/anaconda3/lib/python3.6/site-packages/torch/include -I/home/vrlab/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/vrlab/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/home/vrlab/anaconda3/lib/python3.6/site-packages/torch/include/THC -I:/usr/local/cuda-10.1/include -I/home/vrlab/anaconda3/include/python3.6m -c src/deform_conv_cuda.cpp -o build/temp.linux-x86_64-3.6/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++ 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)’: src/deform_conv_cuda.cpp:66:3: error: ‘AT_CHECK’ was not declared in this scope AT_CHECK(weight.ndimension() == 4, ^~~~ src/deform_conv_cuda.cpp:66:3: note: suggested alternative: ‘DCHECK’ AT_CHECK(weight.ndimension() == 4, ^~~~ DCHECK 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)’: src/deform_conv_cuda.cpp:194:3: error: ‘AT_CHECK’ was not declared in this scope AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset"); ^~~~ src/deform_conv_cuda.cpp:194:3: note: suggested alternative: ‘DCHECK’ AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset"); ^~~~ DCHECK 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)’: src/deform_conv_cuda.cpp:301:3: error: ‘AT_CHECK’ was not declared in this scope AT_CHECK((offset.size(0) == batchSize), 3, "invalid batch size of offset"); ^~~~ src/deform_conv_cuda.cpp:301:3: note: suggested alternative: ‘DCHECK’ AT_CHECK((offset.size(0) == batchSize), 3, "invalid batch size of offset"); ^~~~ DCHECK 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)’: src/deform_conv_cuda.cpp:417:3: error: ‘AT_CHECK’ was not declared in this scope AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset"); ^~~~ src/deform_conv_cuda.cpp:417:3: note: suggested alternative: ‘DCHECK’ AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset"); ^~~~ DCHECK 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)’: src/deform_conv_cuda.cpp:497:3: error: ‘AT_CHECK’ was not declared in this scope AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous"); ^~~~ src/deform_conv_cuda.cpp:497:3: note: suggested alternative: ‘DCHECK’ AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous"); ^~~~ DCHECK 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)’: src/deform_conv_cuda.cpp:579:3: error: ‘AT_CHECK’ was not declared in this scope AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous"); ^~~~ src/deform_conv_cuda.cpp:579:3: note: suggested alternative: ‘DCHECK’ AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous"); ^~~~ DCHECK error: command 'gcc' failed with exit status 1

haofeixu commented 4 years ago

Hi, what's your pytorch version? You are recommended to use exactly the same version as ours (pytorch 1.2.0).

sunshinnnn commented 4 years ago

'1.5.1+cu101'

haofeixu commented 4 years ago

You may want to downgrade pytorch to 1.2.0 and build again.

sunshinnnn commented 4 years ago

Yeah, I just make a try as your suggestion, and I've compiled this module successful, Thanks very much!

An additional question, any intuitive reason for torch1.5 doesn't work. (Not necessary for a clear answer)

haofeixu commented 4 years ago

Possibly due to pytorch api change according to error: ‘AT_CHECK’ was not declared in this scope.