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

error when running the demo #2

Closed
xinghedyc opened this issue Nov 12, 2016 · 21 comments
Closed

error when running the demo #2

xinghedyc opened this issue Nov 12, 2016 · 21 comments

Comments

@xinghedyc
Copy link

Hi, I meet error when running the demo.
Traceback (most recent call last):
File "faster_rcnn/demo.py", line 12, in
from lib.networks.factory import get_network
File "/home/dyc/workspace/TFFRCNN/lib/networks/init.py", line 8, in
from .VGGnet_train import VGGnet_train
File "/home/dyc/workspace/TFFRCNN/lib/networks/VGGnet_train.py", line 2, in
from network import Network
File "/home/dyc/workspace/TFFRCNN/lib/networks/network.py", line 4, in
from ..roi_pooling_layer import roi_pooling_op as roi_pool_op
File "/home/dyc/workspace/TFFRCNN/lib/roi_pooling_layer/init.py", line 7, in
import roi_pooling_op
File "/home/dyc/workspace/TFFRCNN/lib/roi_pooling_layer/roi_pooling_op.py", line 5, in
_roi_pooling_module = tf.load_op_library(filename)
File "/home/dyc/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/load_library.py", line 63, in load_op_library
raise errors._make_specific_exception(None, None, error_msg, error_code)
tensorflow.python.framework.errors.NotFoundError: /home/dyc/workspace/TFFRCNN/lib/roi_pooling_layer/roi_pooling.so: undefined symbol: _ZN10tensorflow7strings6StrCatB5cxx11ERKNS0_8AlphaNumE

@CharlesShang
Copy link
Owner

Hi, @xinghedyc , I think you first should go to ./lib/ dir and run make

@CharlesShang
Copy link
Owner

Maybe, you should edit the g++ config according to your platform to ensure the roi_pooing.so is correct.
See ./lib/make.sh

@xinghedyc
Copy link
Author

@CharlesShang thanks for your reply, but the make command seems right to generate roi_pooing.so.

1 similar comment
@xinghedyc
Copy link
Author

@CharlesShang thanks for your reply, but the make command seems right to generate roi_pooing.so.

@CharlesShang
Copy link
Owner

It happened to me too, the roi_pooing.so seems all right, but it just could not work.
Check this issue: Failed when running tf.load_op_library(roi_pooling_so)
It's very embarrassing to say that I've not figured out the real solution. Alternatively, you can download a already-compiled .so file, or try re-start your machine.

@xinghedyc
Copy link
Author

@CharlesShang thanks a lot, but your link to download the roi_pooling_so seems unreachable?
https://github.com/CharlesShang/TFFRCNN/tree/master/lib/roi_pooling_layer/roi_pooling.so
it shows 404 not found?

@CharlesShang
Copy link
Owner

Try this link so version

@xinghedyc
Copy link
Author

@CharlesShang it's embarrassingto say that the same error occurs when using your .so file.
It's so strange.
Thanks you anyway!

@xinghedyc
Copy link
Author

python faster_rcnn/demo.py VGGnet_fast_rcnn_iter_70000.ckpt
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:125] successfully opened CUDA library libcurand.so locally
faster_rcnn
Traceback (most recent call last):
File "faster_rcnn/demo.py", line 12, in
from lib.networks.factory import get_network
File "/home/dyc/workspace/TFFRCNN/lib/networks/init.py", line 8, in
from .VGGnet_train import VGGnet_train
File "/home/dyc/workspace/TFFRCNN/lib/networks/VGGnet_train.py", line 2, in
from network import Network
File "/home/dyc/workspace/TFFRCNN/lib/networks/network.py", line 4, in
from ..roi_pooling_layer import roi_pooling_op as roi_pool_op
File "/home/dyc/workspace/TFFRCNN/lib/roi_pooling_layer/init.py", line 7, in
import roi_pooling_op
File "/home/dyc/workspace/TFFRCNN/lib/roi_pooling_layer/roi_pooling_op.py", line 5, in
_roi_pooling_module = tf.load_op_library(filename)
File "/home/dyc/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/load_library.py", line 63, in load_op_library
raise errors._make_specific_exception(None, None, error_msg, error_code)
tensorflow.python.framework.errors.NotFoundError: /home/dyc/workspace/TFFRCNN/lib/roi_pooling_layer/roi_pooling.so: undefined symbol: _ZN10tensorflow7strings6StrCatB5cxx11ERKNS0_8AlphaNumE

@CharlesShang
Copy link
Owner

I googled it, found: GPflow/GPflow#173
According to james, the problem is tf and roi_pooling are built with different versions of g++,
Try to add -D_GLIBCXX_USE_CXX11_ABI=0 in your make.sh will solve this issue

I've already push the fixed make.sh to master branch, you can go to TFFRCNN root dir and run git pull, then complie the roi_pooling.so

@CharlesShang
Copy link
Owner

If it does not work, try to install a different version of g++, via sudo apt-get install g++-4.x or sudo apt-get install g++-5.x
Then run
sudo rm /usr/bin/g++
sudo ln -s /usr/bin/g++-4.x /usr/bin/g++

@xinghedyc
Copy link
Author

@CharlesShang thanks very much for your help!
it works now, really thanks you!

@CharlesShang
Copy link
Owner

Glad to hear that. Maybe we've found out the real solution to this kind of issue

@jwnsu
Copy link

jwnsu commented Nov 14, 2016

for gcc5, simply add this to compile flag "-D_GLIBCXX_USE_CXX11_ABI=0", then it will work fine. It's documented issue by tensor flow: https://www.tensorflow.org/versions/r0.10/how_tos/adding_an_op/index.html, search for "gcc5".

@CharlesShang
Copy link
Owner

@jwnsu Thanks for your helpful discussion. Learned a lot .

@civilman628
Copy link

update as:

g++ -std=c++11 -shared -o roi_pooling.so roi_pooling_op.cc  -D_GLIBCXX_USE_CXX11_ABI=0  \
	roi_pooling_op.cu.o -I $TF_INC  -D GOOGLE_CUDA=1 -fPIC $CXXFLAGS \
	-lcudart -L $CUDA_PATH/lib64 

@nsivaramakrishnan
Copy link

Hi,
I am getting the same error while trying to run demo.py:
tensorflow.python.framework.errors_impl.NotFoundError: /home/fmc/rcnn/Faster-RCNN_TF/tools/../lib/roi_pooling_layer/roi_pooling.so: undefined symbol: _Z22ROIPoolBackwardLaucherPKffiiiiiiiS0_PfPKiRKN5Eigen9GpuDeviceE
I added "-D_GLIBCXX_USE_CXX11_ABI=0" in make,sh. I use g++ version 5.4.0 and TF V0.12. Btw, am trying to run this on CPU. Any help is highly appreciated.
-Siva

@chaochaow
Copy link

@nsivaramakrishnan I got the same problem like yours when running on CPU. Do you have any luck to solve this issue?

@louisquinn
Copy link

@nsivaramakrishnan @chaochaow
I'm getting a similar issue when attempting to build for CPU:
Faster-RCNN_TF/tools/../lib/roi_pooling_layer/roi_pooling.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringEv

This looks like a missing tensorflow symbol.
I'm using g++ v5.4.0 as well. Not sure if downgrading to v4.x will help.

@chaochaow
Copy link

GPU version does not have this problem

@kalanityL
Copy link

I had the issue with GPU
solution given by @Griovwe here worked:
you have to add "-D_GLIBCXX_USE_CXX11_ABI=0" to both the g++ lines for roi_pooling layer and psroi_pooling layer if you encountered this problem.

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

8 participants