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

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

Open
djongpo opened this issue Jun 30, 2019 · 3 comments
Open

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

djongpo opened this issue Jun 30, 2019 · 3 comments

Comments

@djongpo
Copy link

djongpo commented Jun 30, 2019

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
Copy link
Author

djongpo commented Jul 1, 2019

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
Copy link

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
Copy link

probably do this as well:

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

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

2 participants