Error when JIT compilation
Closed this issue · 5 comments
I got the following error:
[1/4] c++ -MMD -MF roi_align_binding.o.d -DTORCH_EXTENSION_NAME=roialign -I/opt/pytorch/torch/lib/include -I/opt/pytorch/torch/lib/include/TH -I/opt/pytorch/torch/lib/include/THC -I/share/data/vision-greg/rluo/local/cuda-8.0/include -I/opt/conda/include/python3.6m -fPIC -std=c++11 -c /share/data/vision-greg/rluo/detectorch/lib/cppcuda/roi_align_binding.cpp -o roi_align_binding.o
FAILED: roi_align_binding.o
c++ -MMD -MF roi_align_binding.o.d -DTORCH_EXTENSION_NAME=roialign -I/opt/pytorch/torch/lib/include -I/opt/pytorch/torch/lib/include/TH -I/opt/pytorch/torch/lib/include/THC -I/share/data/vision-greg/rluo/local/cuda-8.0/include -I/opt/conda/include/python3.6m -fPIC -std=c++11 -c /share/data/vision-greg/rluo/detectorch/lib/cppcuda/roi_align_binding.cpp -o roi_align_binding.o
/share/data/vision-greg/rluo/detectorch/lib/cppcuda/roi_align_binding.cpp:1:25: fatal error: torch/torch.h: No such file or directory
compilation terminated.
It seems that it can't find <torch.torch.h> which is supposed to be under /opt/pytorch. But it's not included in the -I options.
Do you have any idea how to solve this.
Hi,
Are you using the master branch? This is only for the master branch. If not you should use the cffi version of RoIAlign.
If you are using the master branch, torch.h is should be in python3.6/site-packages/torch/lib/include/torch/torch.h.
It should be included automatically by load() in (torch.utils.cpp_extension) which is called from https://github.com/ignacio-rocco/detectorch/blob/master/lib/model/roi_align.py
Thanks.
It may because I install it using build develop mode. I will further investigate. Now I just use 0.3 and cffi and it works.
Ok, you should also be able to use cffi with pytorch 0.4 if you modify roi_align.py line 7 to torch_ver = "0.3".
@ruotianluo you need to install using python setup.py install
. Build develop doesn't work
@fmassa I will try it later. thanks.