Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ‘AT_CHECK’ was not declared in this scope #284

Closed
McDifference opened this issue Sep 11, 2020 · 2 comments
Closed

error: ‘AT_CHECK’ was not declared in this scope #284

McDifference opened this issue Sep 11, 2020 · 2 comments

Comments

@McDifference
Copy link

OS: Ubuntu 16.04
Python: 3.6
CUDA: 10.0
PyTorch: 1.2

After I run the command "python setup.py develop", the following errors occured. I have also switched CUDA to 10.1 and tried PyTorch versions of 1.3, 1.4, 1.5, 1.6, but the errors remained the same.

In file included from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/ATen.h:5,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/input-archive.h:6,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/archive.h:3,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/tensor.h:3,
                 from /home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:7:
/home/user/.local/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:354:7: note: declared here
   T * data() const {
       ^
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp: In function ‘int nms_gpu(at::Tensor, at::Tensor, float)’:
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:14:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
 #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
                                       ^
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:16:24: note: in expansion of macro ‘CHECK_CUDA’
 #define CHECK_INPUT(x) CHECK_CUDA(x);CHECK_CONTIGUOUS(x)
                        ^
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:84:5: note: in expansion of macro ‘CHECK_INPUT’
     CHECK_INPUT(boxes);
     ^
In file included from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/ATen.h:5,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/input-archive.h:6,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/archive.h:3,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/tensor.h:3,
                 from /home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:7:
/home/user/.local/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:268:30: note: declared here
   DeprecatedTypeProperties & type() const {
                              ^
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:14:80: error: ‘AT_CHECK’ was not declared in this scope
 #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
                                                                                ^
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:16:24: note: in expansion of macro ‘CHECK_CUDA’
 #define CHECK_INPUT(x) CHECK_CUDA(x);CHECK_CONTIGUOUS(x)
                        ^
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:84:5: note: in expansion of macro ‘CHECK_INPUT’
     CHECK_INPUT(boxes);
     ^
/home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:88:50: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data<T>() is deprecated. Please use Tensor.data_ptr<T>() instead. [-Wdeprecated-declarations]
     const float * boxes_data = boxes.data<float>();
                                                  ^
In file included from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/ATen/ATen.h:5,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/input-archive.h:6,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/archive.h:3,
                 from /home/user/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/serialize/tensor.h:3,
                 from /home/user/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:7:
/home/user/.local/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:354:7: note: declared here
   T * data() const {
       ^
/home/k/workspace/OpenPCDet/pcdet/ops/iou3d_nms/src/iou3d_nms.cpp:89:40: warning: ‘T* at::Tensor::data() const [with T = long int]’ is deprecated: Tensor.data<T>() is deprecated. Please use Tensor.data_ptr<T>() instead. [-Wdeprecated-declarations]
     long * keep_data = keep.data<long>();
@McDifference
Copy link
Author

Problem solved.
The cause of this problem is that OpenPCDet currently does not support PyTorch1.6.
Actually my first build was with CUDA10.1 and PyTorch1.6, and some meta files were generated in the build folder as well as the pcdet.egg-info. I forgot to delete these files before I switched to PyTorch1.2-1.5.

Now I have deleted the whole repo and cloned it again. Build is successful with CUDA10.1 and PyTorch1.5.

@pfollmann
Copy link

pfollmann commented Jul 5, 2021

I think another option would be to replace AT_CHECK with TORCH_CHECK for later Pytorch versions, see here

Also one should now use x.is_cuda() instead of x.type().is_cuda() if x is a Pytorch Tensor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants