vacancy / PreciseRoIPooling

Precise RoI Pooling with coordinate gradient support, proposed in the paper "Acquisition of Localization Confidence for Accurate Object Detection" (https://arxiv.org/abs/1807.11590).
MIT License
772 stars 152 forks source link

Issues related to running your code. #31

Closed kushal-chakraborty closed 5 years ago

kushal-chakraborty commented 5 years ago

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'

vacancy commented 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:

  1. check if the symbolic link filespytorch/prroi_pool/src/prroi_pooling_gpu_impl.cu and .cuh do work. https://github.com/vacancy/PreciseRoIPooling/issues/29
  2. If you are using 2080Ti, make sure you have cuda 10 installed. https://github.com/vacancy/PreciseRoIPooling/issues/24
kushal-chakraborty commented 5 years ago

I 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.

vacancy commented 5 years ago

This seems to be an issue related to pytorch usage. Maybe you can check the official issue list of pytorch for help.

vacancy commented 5 years ago

Closing inactive issues. Feel free to reopen.