Closed kushal-chakraborty closed 5 years ago
There seems to be some error during your compiling the c++ and cuda code. Could you please copy-paste the detailed nvcc/g++ error? Some related issues:
pytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu
and .cuh
do work. https://github.com/vacancy/PreciseRoIPooling/issues/29I think the issue is now related to CUDA and pytorch. I just now installed pytorch 1.0.1 now I get error as
Traceback (most recent call last): File "test.py", line 1, in <module> from prroi_pool import PrRoIPool2D File "/home/pg2017/cse/17071016/PreciseRoIPooling/pytorch/prroi_pool/__init__.py", line 12, in <module> from .prroi_pool import * File "/home/pg2017/cse/17071016/PreciseRoIPooling/pytorch/prroi_pool/prroi_pool.py", line 12, in <module> import torch.nn as nn File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/torch/__init__.py", line 102, in <module> from torch._C import * ImportError: /home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/torch/lib/libtorch.so.1: undefined symbol: nvrtcGetProgramLogSize
when I run test.py
inside the directory PreciseRoiPooling/pytorch/
which contains the code:
from prroi_pool import PrRoIPool2D
from prroi_pool.functional import prroi_pool2d
import cv2
import matplotlib.pyplot as plt
window_height = 7 window_width = 7 spatial_scale = 0.6
feature_map=cv2.imread("/home/pg2017/cse/17071016/img_873.jpg")
rois = ([ [0, 1, 1, 6, 6], [2, 6, 2, 7, 11], [1, 3, 1, 5, 10], [0, 3, 3, 3, 3]])
roi_features = prroi_pool2d(feature_map, rois, window_height, window_width, spatial_scale)
print(roi_features)
I followed issues #29 and #24 but I think they aren't related. If it so, please elaborate what I need to do.
This seems to be an issue related to pytorch usage. Maybe you can check the official issue list of pytorch for help.
Closing inactive issues. Feel free to reopen.
For running your code, I installed ninja using the command
pip install ninja
After that when I tried running the file test.py which contains the lines:
from prroi_pool import PrRoIPool2D from prroi_pool.functional import prroi_pool2d import cv2 import matplotlib.pyplot as plt
window_height = 7 window_width = 7 spatial_scale = 0.6
feature_map=cv2.imread("/home/pg2017/cse/17071016/img_873.jpg")
rois = ([ [0, 1, 1, 6, 6], [2, 6, 2, 7, 11], [1, 3, 1, 5, 10], [0, 3, 3, 3, 3]])
roi_features = prroi_pool2d(feature_map, rois, window_height, window_width, spatial_scale)
print(roi_features)
I encountered the following errors:
Traceback (most recent call last): File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 946, in _build_extension_module check=True) File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/subprocess.py", line 481, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "test.py", line 18, in <module> roi_features = prroi_pool2d(feature_map, rois, window_height, window_width, spatial_scale) File "/home/pg2017/cse/17071016/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 44, in forward _prroi_pooling = _import_prroi_pooling() File "/home/pg2017/cse/17071016/PreciseRoIPooling/pytorch/prroi_pool/functional.py", line 33, in _import_prroi_pooling verbose=True File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 645, in load is_python_module) File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 814, in _jit_compile with_cuda=with_cuda) File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 863, in _write_ninja_file_and_build _build_extension_module(name, build_directory, verbose) File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 959, in _build_extension_module raise RuntimeError(message) RuntimeError: Error building extension '_prroi_pooling'