-
Notifications
You must be signed in to change notification settings - Fork 896
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
Undefined symbol: #48
Comments
I had the same problem after compiling the custom tf ops. The solution for me was to do not use the parameter "-D_GLIBCXX_USE_CXX11_ABI=0"
This is the script i used for compiling. Hope it helps. In general if you compiled Tensorflow from source with gcc Version >4 you dont need the option -D_GLIBCXX_USE_CXX11_ABI=0.
|
I'm using
The below code is following the guidelines from the readme #/bin/bash
CUDA_ROOT=/usr/local/cuda-9.0
TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())')
TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')
echo $CUDA_ROOT
echo $TF_INC
echo $TF_LIB
$CUDA_ROOT/bin/nvcc tf_sampling_g.cu -o tf_sampling_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
# TF>=1.4.0
g++ -std=c++11 tf_sampling.cpp tf_sampling_g.cu.o -o tf_sampling_so.so -shared -fPIC -I$TF_INC/ -I$TF_INC/external/nsync/public -L$TF_LIB -ltensorflow_framework -I$CUDA_ROOT/include -lcudart -L$CUDA_ROOT/lib64/ -O2 -D_GLIBCXX_USE_CXX11_ABI=0 |
Hello, |
Hello, the configuration of my computer is the same as yours. Have you solved this problem yet? |
@lqzhao You should try the way mentioned by Bierfass. We have the same environments, and I made it work in that way. |
Hi, I had the same problem. |
Thanks for your enthusiastic reply, I‘ve solved this problem. |
I am using |
@pournami123 have you solve it ? i met the same problem as you when i run tensorlfow1.13.1, but it can work at tensorflow 1.9.0. |
oh is it? Ok... I couldn't solve the problem with my tensorflow version. |
Besides taking the "-D_GLIBCXX_USE_CXX11_ABI=0" parameter of the g++, I got to fix my problem with this: you need to see if the -ltensorflow_framework was linked properlly in your tf_ops *.so. For that, use: $ldd tf_grouping_so.so (for example) check if the libtensorflow_framework.so is in the list (2). If it isn't, you haven't linked it properly (1).
$sudo ln -s libtensorflow_framework.so.x libtensorflow_framework.so
That's it. you can check again with ldd to see if the library is there in the list and being properly found. and run your train.py I was able to solve it in an anaconda python 3.7, with g++ 7.5, tensorflow 2.1 |
can you fix tihs problem yet? I have similar env with urs |
Hello @CaineGu , No i didn't fix it yet :( |
Could you please tell me how to check f the -ltensorflow_framework was linked properlly? I have a similar env with you |
Well, in my text i said how you can check it... just use "ldd" in the tf_ops you are trying to compile. |
I met the same problem. On Ubuntu 18.04, how to deploy the setting? Still meet the same error. |
I met the same problem as well. Have you fixed it? |
@pauloffsf This solution worked for me. Thank you |
Hello everyone :) thanks for posting this. @vajrag I have the same configuration as you: g++ 5.5 and Python 3.6, Tensorflow-GPU 1.14 (but I have Cuda version- 10.2). Maybe I did not get how to solve the problem, but I still get the error:
I've tried to go in the path: /path/to/filename/ and run
So neither libtensorflow_framework.so, nor libtensorflow_framework.so.x is listed here. What did I miss? |
Hi @gvalvano, libtensorflow_framework.so.1 is not on the list. You can follow step 1 from @pauloffsf 's solution. And I have commented the
|
Thank you for your help :) I've tried doing it, but it seems that running (1) has no effect on the output of (2). These are the exact commands I ran (I just copy-paste them below):
and the last command still gives me:
In the folder, I have a Makefile with the following content:
I did not write the above code, so I'm not totally sure of what it does. My tensorflow version is 1.14.0, so Thanks a lot for helping me with this :) :) |
@gvalvano hi! After that, you go back to the folder your high_dim_filter.so is to compile it again, and then, check if the tensorflow lib is listed with ldd. |
Thanks @pauloffsf, that's clearer now. But unfortunately, this still didn't solve my issue :( I'm using a virtual environment named
And, in fact, there it is!
now I also have
but I still get:
I really don't understand the problem here :/ |
Maybe the addresses that you are getting in the make file are not responding as they should in the terminal and so it is not linking the tensorflow lib properly. Why dont you try compiling it with "hard" addresses first? |
Nice catch! That was one problem, indeed! But I have a new problem now 😅
After re-compiling, and
Now, we have I have Thanks a lot for you help 😁 |
@gvalvano , so you have solved it... just check the second part of my solution (I copied it here): " It is looking for libtensorflow_framework.so.1 because it is the lib it will use. The libtensorflow_framework.so created is just a symbolic link to it. We need the symbolic link because when we link a library with -lsomething (in this case ltensorflow_framework), it looks for libsomething.so ( libtensorflow_framework.so for us). |
@pauloffsf thanks, that solved the issue with the linking! 😁 😁 As @vajrag , I also had to comment the |
Hi, I am using TF 1.15.3 and a forked version of this model https://github.com/irfan798/pointnet2/tree/master. |
Similar problemtf_sampling_so.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringEv Configurationpython 2.7 CompilationCUDA_ROOT=/usr/local/cuda-9.0/ ${CUDA_ROOT}bin/nvcc tf_sampling_g.cu -o tf_sampling_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC g++ -std=c++11 tf_sampling.cpp tf_sampling_g.cu.o -o tf_sampling_so.so -shared -fPIC -I ${TF_ROOT}/include -I ${CUDA_ROOT}/include -lcudart -L ${CUDA_ROOT}/lib64/ -L ${TF_ROOT} -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0 and CUDA_ROOT=/usr/local/cuda-9.0/ ${CUDA_ROOT}bin/nvcc tf_grouping_g.cu -o tf_grouping_g.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC g++ -std=c++11 tf_grouping.cpp tf_grouping_g.cu.o -o tf_grouping_so.so -shared -fPIC -I ${TF_ROOT}/include -I ${CUDA_ROOT}/include -lcudart -L ${CUDA_ROOT}/lib64/ -L ${TF_ROOT} -ltensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0 |
wonderful! |
I am still getting the same error: tensorflow.pythn.framework.errors_iml.notfounderror. undefined symbol:_ZTIN10tensorflow8OpKernelE. I referred the comment given by pauloffsf and checked with ldd tf_grouping_so.so. and it doesnt show any tensorflow linked. When I tried to use sudo, It asking for the permission. I am using my university laptop for working on this code and I think, I dont have access to run sudo commnds. commenting: "-D_GLIBCXX_USE_CXX11_ABI=0" doesnt work for me. What shall I do now ? Please someone help. Thanks. |
Hello, I am trying to run: python train.py. I get the the following error
-workstation:~/pointnet2$ python train.py
/usr/local/lib/python2.7/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from
float
tonp.floating
is deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type
.from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "train.py", line 52, in
MODEL = importlib.import_module(FLAGS.model) # import network module
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/baxter/pointnet2/models/pointnet2_cls_ssg.py", line 13, in
from pointnet_util import pointnet_sa_module
File "/home/baxter/pointnet2/utils/pointnet_util.py", line 15, in
from tf_sampling import farthest_point_sample, gather_point
File "/home/baxter/pointnet2/tf_ops/sampling/tf_sampling.py", line 12, in
sampling_module=tf.load_op_library(os.path.join(BASE_DIR, 'tf_sampling_so.so'))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/load_library.py", line 56, in load_op_library
lib_handle = py_tf.TF_LoadLibrary(library_filename, status)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /home/baxter/pointnet2/tf_ops/sampling/tf_sampling_so.so: undefined symbol: _ZTIN10tensorflow8OpKernelE
The text was updated successfully, but these errors were encountered: