Duankaiwen / CenterNet

Codes for our paper "CenterNet: Keypoint Triplets for Object Detection" .

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cpp problem

EillotY opened this issue · comments

when i use this code in linux,i met this problem which i first met:
the path :CenterNet-master/models/py_utils/_cpools/setup.py
so python setup.py build,bellow happens which i cannot figure out:
hoping you can work out my problem,thanks:
the error below:
(base) amax@amax:~/yjw/yjw/CenterNet-master/models/py_utils/_cpools$ python setup.py build
running build
running build_ext
building 'top_pool' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -B /home/amax/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/amax/anaconda3/lib/python3.7/site-packages/torch/include -I/home/amax/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/amax/anaconda3/lib/python3.7/site-packages/torch/include/TH -I/home/amax/anaconda3/lib/python3.7/site-packages/torch/include/THC -I/home/amax/anaconda3/include/python3.7m -c src/top_pool.cpp -o build/temp.linux-x86_64-3.7/src/top_pool.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=top_pool -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/top_pool.cpp:1:0:
/home/amax/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:11:4: warning: #warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/extension.h" [-Wcpp]

warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/ex

^

src/top_pool.cpp: In function ‘std::vectorat::Tensor top_pool_backward(at::Tensor, at::Tensor)’:
src/top_pool.cpp:44:41: error: could not convert ‘at::CUDA((c10::ScalarType)6)’ from ‘at::DeprecatedTypeProperties’ to ‘c10::IntArrayRef {aka c10::ArrayRef}’
auto max_val = at::zeros(torch::CUDA(at::kFloat), {batch, channel, width});
^
src/top_pool.cpp:45:41: error: could not convert ‘at::CUDA((c10::ScalarType)4)’ from ‘at::DeprecatedTypeProperties’ to ‘c10::IntArrayRef {aka c10::ArrayRef}’
auto max_ind = at::zeros(torch::CUDA(at::kLong), {batch, channel, width});
^
src/top_pool.cpp:57:44: error: could not convert ‘at::CUDA((c10::ScalarType)0)’ from ‘at::DeprecatedTypeProperties’ to ‘c10::IntArrayRef {aka c10::ArrayRef}’
auto gt_mask = at::zeros(torch::CUDA(at::kByte), {batch, channel, width});
^
src/top_pool.cpp:58:44: error: could not convert ‘at::CUDA((c10::ScalarType)6)’ from ‘at::DeprecatedTypeProperties’ to ‘c10::IntArrayRef {aka c10::ArrayRef}’
auto max_temp = at::zeros(torch::CUDA(at::kFloat), {batch, channel, width});
^
error: command 'gcc' failed with exit status 1

commented

I got the same problem. Have you solved it? @EillotY

Sry, i have not figure it out either.Try another method?

commented

Cuda version and pytorch version cause this problem. I solved it by using the corner pooling code from thie https://github.com/learnerjsk/CornerNet-Lite @EillotY

ok, thanks.So corner_net can you train your own datasets?

commented

ok, thanks.So corner_net can you train your own datasets?

yes

ok, thanks.So corner_net can you train your own datasets?

yes

ok ,thanks bro