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

Does this work for 0.4.1 / how to install? #12

Open
andrewjong opened this issue Dec 3, 2018 · 17 comments
Open

Does this work for 0.4.1 / how to install? #12

andrewjong opened this issue Dec 3, 2018 · 17 comments

Comments

@andrewjong
Copy link

andrewjong commented Dec 3, 2018

Just checking if this works with PT 0.4.1 as well, because the README only specifies 0.4. I ask because I noticed the PyTorch 0.4.1 release tag includes "Breaking changes". Thanks!

@andrewjong
Copy link
Author

andrewjong commented Dec 3, 2018

I get the following compile error when running ./travis.sh

.conda/envs/pt0.4/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:12:10: 
fatal error: cuda.h: No such file or directory
 #include "cuda.h"

@andrewjong
Copy link
Author

Nevermind, got it to compile by symlinking the include files from my cuda install location.

ln -s /opt/cuda/include/* ~/.conda/envs/pt0.4/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/THC/

@andrewjong
Copy link
Author

I now get this error in python after running travis.sh:

>>> from prroi_pool import PrRoIPool2D
Traceback (most recent call last):
  File "/home/user/Development/PreciseRoIPooling-master/pytorch/prroi_pool/functional.py", line 16, in <module>
    from . import _prroi_pooling
  File "/home/user/Development/PreciseRoIPooling-master/pytorch/prroi_pool/_prroi_pooling/__init__.py", line 3, in <module>
    from .__prroi_pooling import lib as _lib, ffi as _ffi
ImportError: /home/user/Development/PreciseRoIPooling-master/pytorch/prroi_pool/_prroi_pooling/__prroi_pooling.so: undefined symbol: __cudaPopCallConfiguration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/Development/PreciseRoIPooling-master/pytorch/prroi_pool/__init__.py", line 12, in <module>
    from .prroi_pool import *
  File "/home/user/Development/PreciseRoIPooling-master/pytorch/prroi_pool/prroi_pool.py", line 14, in <module>
    from .functional import prroi_pool2d
  File "/home/user/Development/PreciseRoIPooling-master/pytorch/prroi_pool/functional.py", line 18, in <module>
    raise ImportError('Can not found the compiled Precise RoI Pooling library. Run ./travis.sh in the directory first.')
ImportError: Can not found the compiled Precise RoI Pooling library. Run ./travis.sh in the directory first.

@andrewjong andrewjong reopened this Dec 3, 2018
@andrewjong andrewjong changed the title Does this work for 0.4.1? Does this work for 0.4.1 / How to Install? Dec 3, 2018
@andrewjong andrewjong changed the title Does this work for 0.4.1 / How to Install? Does this work for 0.4.1 / how to install? Dec 3, 2018
@vacancy
Copy link
Owner

vacancy commented Dec 29, 2018

Hi Andrew. I think this is not a problem with pytorch but your cuda installation. Could you please check if the version of your cuda runtime libraries matches the compile-time headers/libraries?

@lianxintao
Copy link

I also encountered the same problem, I don't know if this is a common problem.

@lianxintao
Copy link

lianxintao commented Jan 22, 2019

ImportError: /home/user/Development/PreciseRoIPooling-master/pytorch/prroi_pool/_prroi_pooling/__prroi_pooling.so: undefined symbol: __cudaPopCallConfiguration>
I don't know how to solve this problem.

@deepbrainme
Copy link

Hi,I can't compile this library , could you give me some advice about this?

Creating extension directory /tmp/torch_extensions/prroi_pooling...
Detected CUDA files, patching ldflags
Emitting ninja build file /tmp/torch_extensions/prroi_pooling/build.ninja...
Building extension module prroi_pooling...
[1/3] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/ning/miniconda3/envs/ATOM/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /home/ning/code/atom/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
[2/3] c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/ning/miniconda3/envs/ATOM/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/ning/code/atom/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
[3/3] c++ prroi_pooling_gpu.o prroi_pooling_gpu_impl.cuda.o -shared -L/usr/local/cuda/lib64 -lcudart -o _prroi_pooling.so
Loading extension module _prroi_pooling...
Can not compile Precise RoI Pooling library.
Done

@vacancy
Copy link
Owner

vacancy commented Apr 25, 2019

Hi @DeepBrainsMe This looks like a cuda setup problem. Can you go to https://github.com/vacancy/PreciseRoIPooling/blob/master/pytorch/prroi_pool/functional.py#L24-L25 and see why an ImportError is raised?

@deepbrainme
Copy link

deepbrainme commented Apr 26, 2019 via email

@vacancy
Copy link
Owner

vacancy commented Apr 26, 2019

Hi @DeepBrainsMe It seems that this is a bug with other functions you are using in your code. Perhaps this issue is related? facebookresearch/Detectron#260

Also, can you run a small script to test whether the PrRoIPooling are working? Here is a small snippet:

        pool = PrRoIPool2D(2, 2, spatial_scale=0.5)

        features = torch.rand((4, 2, 24, 32)).cuda()
        rois = torch.tensor([
            [0, 0, 0, 4, 4],
            [1, 14, 14, 18, 18],
        ]).float().cuda()
        features.requires_grad = rois.requires_grad = True
        out = pool(features, rois)

        loss = out.sum()
        loss.backward()

@Hevans123
Copy link

Hi, @DeepBrainsMe @vacancy I meet some problem when I compile this library.It seems that there is something wrong using Ninja-build. Could you give me some advice. Thanks.
[1/3] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem ....... -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /../PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
FAILED: prroi_pooling_gpu_impl.cuda.o
error: expected a declaration
1 error detected in the compilation of "/tmp/tmpxft_0000becb_00000000-6_prroi_pooling_gpu_impl.cpp1.ii".
......
......
ninja: build stopped: subcommand failed.
Error building extension '_prroi_pooling'
Done

@20143698lhy
Copy link

Hi, @DeepBrainsMe @vacancy I meet some problem when I compile this library.It seems that there is something wrong using Ninja-build. Could you give me some advice. Thanks.
[1/3] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem ....... -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /../PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
FAILED: prroi_pooling_gpu_impl.cuda.o
error: expected a declaration
1 error detected in the compilation of "/tmp/tmpxft_0000becb_00000000-6_prroi_pooling_gpu_impl.cpp1.ii".
......
......
ninja: build stopped: subcommand failed.
Error building extension '_prroi_pooling'
Done

I meet the same issue with you , my issue is following:

prroi_pooling_gpu_impl.cu(1): error: expected a declaration
1 error detected in the compilation of "/tmp/tmpxft_00001823_00000000-6_prroi_pooling_gpu_impl.cpp1.ii".

my environment of CUDA and NVCC is ok
can you give me some advices? thanks

@vacancy

@QIQIVTrackingY
Copy link

How do you slove the first problem? I have the same problem with you. Thank you. @DeepBrainsMe

@haodongze
Copy link

Detected CUDA files, patching ldflags
Emitting ninja build file /tmp/torch_extensions/prroi_pooling/build.ninja...
Building extension module prroi_pooling...
[1/3] /home/haodongze/tools/cuda-9.0/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/TH -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/THC -isystem /home/haodongze/tools/cuda-9.0/include -isystem /home/haodongze/.conda/envs/pytorch/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
_ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++11 -c /home/haodongze/tracking/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
FAILED: prroi_pooling_gpu_impl.cuda.o
/home/haodongze/tools/cuda-9.0/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/TH -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/THC -isystem /home/haodongze/tools/cuda-9.0/include -isystem /home/haodongze/.conda/envs/pytorch/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -std=c++11 -c /home/haodongze/tracking/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
/bin/sh: 1: /home/haodongze/tools/cuda-9.0/bin/nvcc: not found
[2/3] c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/TH -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/THC -isystem /home/haodongze/tools/cuda-9.0/include -isystem /home/haodongze/.conda/envs/pytorch/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/haodongze/tracking/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
FAILED: prroi_pooling_gpu.o
c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/TH -isystem /home/haodongze/.local/lib/python3.6/site-packages/torch/include/THC -isystem /home/haodongze/tools/cuda-9.0/include -isystem /home/haodongze/.conda/envs/pytorch/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/haodongze/tracking/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
In file included from /home/haodongze/.local/lib/python3.6/site-packages/torch/include/ATen/cuda/CUDAContext.h:5:0,
from /home/haodongze/tracking/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c:15:
/home/haodongze/.local/lib/python3.6/site-packages/torch/include/c10/cuda/CUDAStream.h:6:10: 致命错误:cuda_runtime_api.h:没有那个文件或目录
请问怎么解决这个问题

@Manguotree
Copy link

Hi,I can't compile this library , could you give me some advice about this?

Creating extension directory /tmp/torch_extensions/prroi_pooling... Detected CUDA files, patching ldflags Emitting ninja build file /tmp/torch_extensions/prroi_pooling/build.ninja... Building extension module prroi_pooling... [1/3] /usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/ning/miniconda3/envs/ATOM/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS -D__CUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -std=c++11 -c /home/ning/code/atom/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu -o prroi_pooling_gpu_impl.cuda.o
[2/3] c++ -MMD -MF prroi_pooling_gpu.o.d -DTORCH_EXTENSION_NAME=_prroi_pooling -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/TH -isystem /home/ning/miniconda3/envs/ATOM/lib/python3.6/site-packages/torch/lib/include/THC -isystem /usr/local/cuda/include -isystem /home/ning/miniconda3/envs/ATOM/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/ning/code/atom/pytracking/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/src/prroi_pooling_gpu.c -o prroi_pooling_gpu.o
[3/3] c++ prroi_pooling_gpu.o prroi_pooling_gpu_impl.cuda.o -shared -L/usr/local/cuda/lib64 -lcudart -o _prroi_pooling.so
Loading extension module _prroi_pooling...
Can not compile Precise RoI Pooling library.
Done

How do you slove the first problem?@DeepBrainsMe ,thanks

@deepbrainme
Copy link

deepbrainme commented Oct 19, 2019 via email

@aqqw2000
Copy link

Hi,I can't compile this library , could you give me some advice about this? thank you
myemail :[email protected]
python run_tracker.py dimp dimp50 --dataset otb --sequence Basketball
Evaluating 1 trackers on 1 sequences
Tracker: dimp dimp50 None , Sequence: Basketball
/home/zzy/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py:2479: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
Using /tmp/torch_extensions as PyTorch extensions root...
Command '['which', 'c++']' returned non-zero exit status 1.
Done

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

10 participants