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 when compiling: 'TORCH_CHECK_ARG' was not declared in this scope #50

Open
AlpAcA0072 opened this issue Mar 24, 2022 · 6 comments
Open

Comments

@AlpAcA0072
Copy link

Hi,
My environment is PyTorch 1.8.1+cu101 and CUDA 10.1.
When I compiled DCNv2, an error was encounted:

/DCNv2_latest/src/cpu/dcn_v2_cpu.cpp: In function 'std::vector<at::Tensor> dcn_v2_cpu_backward(const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, const at::Tensor&, int, int, int, int, int, int, int, int, int)':
/DCNv2_latest/src/cpu/dcn_v2_cpu.cpp:141:5: error: 'TORCH_CHECK_ARG' was not declared in this scope
     TORCH_CHECK_ARG(input.is_contiguous(), 1, "input tensor has to be contiguous");
     ^~~~~~~~~~~~~~~
/DCNv2_latest/src/cpu/dcn_v2_cpu.cpp:141:5: note: suggested alternative: 'TORCH_CHECK_MSG'
     TORCH_CHECK_ARG(input.is_contiguous(), 1, "input tensor has to be contiguous");
     ^~~~~~~~~~~~~~~
     TORCH_CHECK_MSG

I wonder how to solve this problem.
Thanks a lot.

@Natsu-Akatsuki
Copy link
Contributor

Natsu-Akatsuki commented Mar 24, 2022

According to the latest README.md. Try to checkout the last commit. e.g

git checkout fa9b2fd740ced2a22e0e7e913c3bf3934fd08098

@bodhiyang
Copy link

i encountered the same problem. do u figure it out now?

@hongyujinhongyu
Copy link

I encountered the same. Still no clue to solve


error: 'TORCH_CHECK_ARG' was not declared in this scope
TORCH_CHECK_ARG(input.is_contiguous(), 1, "input tensor has to be contiguous");
........
........
/{my_prokect_dir}/src/lib/models/networks/DCNv2_latest-master/src/cpu/dcn_v2_cpu.cpp:235:65: warning: 'T* at::Tensor::data() const [with T = float]' is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
columns.data<scalar_t>());
^
In file included from /usr/local/lib/python3.6/dist-packages/torch/include/ATen/Tensor.h:3:0,
from /usr/local/lib/python3.6/dist-packages/torch/include/ATen/Context.h:4,
from /usr/local/lib/python3.6/dist-packages/torch/include/ATen/ATen.h:9,
from /data/aif/hongyu/may_compare_task/centernet/centernet-master/src/lib/models/networks/DCNv2_latest-master/src/cpu/dcn_v2_cpu.cpp:4:
/usr/local/lib/python3.6/dist-packages/torch/include/ATen/core/TensorBody.h:395:7: note: declared here
T * data() const {
^
error: command 'g++' failed with exit status 1

                                                                              ^

@fly2skyToEnjoy
Copy link

You are Good! @Natsu-Akatsuki

@pure19990902
Copy link

I encountered the same problem. Do you figure it out now?

@AlpAcA0072
Copy link
Author

One possible solution to the error is to downgrade PyTorch to version 1.6.x. This problem may be caused by incompatible versions of DCNV2 with PyTorch.

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

6 participants