deepsense-ai / roi-pooling

460 stars 127 forks source link

Issues related to non existence of a file in this repo #28

Open djongpo opened 5 years ago

djongpo commented 5 years ago

I have written my own code for doing RoI pooling of an image. Here is the code : from roi_pooling.roi_pooling_ops import roi_pooling from keras.applications.vgg16 import VGG16 from keras.models import Model import matplotlib.pyplot as plt import cv2 import tensorflow as tf

img=cv2.imread("img_1.jpg") model = VGG16()

feature_map=model.predict(img)

feature_map = np.asarray(feature_map, dtype='float32')

rois_value = [ [0, 0, 0, 1, 3], [0, 2, 2, 3, 3], [0, 1, 0, 3, 2] ]

rois= np.asarray(rois_value, dtype='int32')

input_const = tf.constant(feature_map, tf.float32) rois_const = tf.constant(rois, tf.int32)

rpooling = roi_pooling(input_const, rois_const, 7, 7)

plt.imsave("1.png",rpooling) `

My directory looks like this: ->roi_pooling ----->roi_pooling_test.py ----->roi_pooling_ops.py ----->roi_pooling.cu.o ----->roi_pooling.cu.cc ----->test.py ->setup.py ->build ----->lib -------->roi_pooling ----------->roi_pooling_test.py ----------->roi_pooling_ops.py ->image.jpg (testing image)

The error shown is Traceback (most recent call last): File "roi.py", line 2, in <module> from roi_pooling.roi_pooling_ops import roi_pooling File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/roi_pooling/roi_pooling_ops.py", line 8, in <module> roi_pooling_module = tf.load_op_library(lib_path) File "/home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/tensorflow/python/framework/load_library.py", line 61, in load_op_library lib_handle = py_tf.TF_LoadLibrary(library_filename) tensorflow.python.framework.errors_impl.NotFoundError: /home/pg2017/cse/17071016/.conda/envs/myenv/lib/python3.7/site-packages/roi_pooling/roi_pooling.so: cannot open shared object file: No such file or directory

Can anybody address this problem?

Thanks in advance. Waiting for a reply.

NOTE I have tensorflow version 1.13.0 and it can't be downgraded to 1.0.0

djongpo commented 5 years ago

I think the error might be due to this:

While running python steup.py install I ran into a problem which says /usr/bin/ld: cannot find -lcudart . How to fix this issue?. I think this is the reason that the required file is not installed. Can anyone address this issue?

dataSci-rigo commented 4 years ago

was: roi_pooling.so: roi_pooling.cc roi_pooling.cu.o g++ -std=c++11 -shared -o $@ $? -I $(TF_INC) -fPIC -lcudart -L$(CUDA_LIB) -D _GLIBCXX_USE_CXX11_ABI=0 is: -L/usr/local/cuda-8.0/lib64 -lcudart

dataSci-rigo commented 4 years ago

probably do this as well:

sudo ldconfig /usr/local/cuda-8.0/lib64