CenterPoint icon indicating copy to clipboard operation
CenterPoint copied to clipboard

About the new version of the pytorch, and the build of the den of det3d

Open Orign-al opened this issue 1 year ago • 0 comments

Pytorch and Cuda Version: 2.6.0.dev20241211+cu126

If use the original build of den of det3d it will report an error of

*FAILED: /home/user/Code/CenterPoint/CenterPoint/det3d/ops/dcn/build/temp.linux-x86_64-cpython-311/src/deform_conv_cuda.o c++ -MMD -MF /home/user/Code/CenterPoint/CenterPoint/det3d/ops/dcn/build/temp.linux-x86_64-cpython-311/src/deform_conv_cuda.o.d -pthread -B /home/user/anaconda3/envs/centerpoint_py31/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/user/anaconda3/envs/centerpoint_py31/include -fPIC -O2 -isystem /home/user/anaconda3/envs/centerpoint_py31/include -fPIC -DWITH_CUDA -I/home/user/anaconda3/envs/centerpoint_py31/lib/python3.11/site-packages/torch/include -I/home/user/anaconda3/envs/centerpoint_py31/lib/python3.11/site-packages/torch/include/torch/csrc/api/include -I/home/user/anaconda3/envs/centerpoint_py31/lib/python3.11/site-packages/torch/include/TH -I/home/user/anaconda3/envs/centerpoint_py31/lib/python3.11/site-packages/torch/include/THC -I/usr/local/cuda-12.6/include -I/home/user/anaconda3/envs/centerpoint_py31/include/python3.11 -c -c /home/user/Code/CenterPoint/CenterPoint/det3d/ops/dcn/src/deform_conv_cuda.cpp -o /home/user/Code/CenterPoint/CenterPoint/det3d/ops/dcn/build/temp.linux-x86_64-cpython-311/src/deform_conv_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1016"' -DTORCH_EXTENSION_NAME=deform_conv_cuda -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17

and

/home/user/Code/CenterPoint/CenterPoint/det3d/ops/dcn/src/deform_conv_cuda.cpp:66:3: error: ‘AT_CHECK’ was not declared in this scope; did you mean ‘CHECK’?

This is the main reason of the failed build.

If you don't want to change your pytorch version you should update the file: CenterPoint\det3d\ops\dcn\src\deform_conv_cuda.cpp

replace all of the : ` AT_CHECK(input.is_contiguous(), "input tensor has to be contiguous");

AT_CHECK(weight.is_contiguous(), "weight tensor has to be contiguous");

AT_CHECK((offset.size(0) == batchSize), "invalid batch size of offset"); `

to the :

` TORCH_CHECK(input.is_contiguous(), "Input tensor has to be contiguous");

TORCH_CHECK(weight.is_contiguous(), "Weight tensor has to be contiguous");

TORCH_CHECK((offset.size(0) == batchSize), "invalid batch size of offset");

` OK,You Can successfully run the build code:

`

python setup.py build_ext --inplace`

Orign-al avatar Dec 12 '24 08:12 Orign-al