sadeepj / crfasrnn_keras

CRF-RNN Keras/Tensorflow version
http://crfasrnn.torr.vision
MIT License
603 stars 169 forks source link

undefined symbol: _ZTIN10tensorflow8OpKernelE #53

Closed fuweilin92 closed 5 years ago

fuweilin92 commented 5 years ago

The last step, run_demo.py, I get this error:

Traceback (most recent call last): File "run_demo.py", line 27, in from crfrnn_model import get_crfrnn_model_def File "./src/crfrnn_model.py", line 28, in from crfrnn_layer import CrfRnnLayer File "./src/crfrnn_layer.py", line 28, in import high_dim_filter_loader File "./src/high_dim_filter_loader.py", line 28, in custom_module = tf.load_op_library(os.path.join(os.path.dirname(file), 'cpp', 'high_dim_filter.so')) File "/home/fu/.local/share/virtualenvs/my_pipenv-ITNpTMim/lib/python3.5/site-packages/tensorflow/python/framework/load_library.py", line 60, in load_op_library lib_handle = py_tf.TF_LoadLibrary(library_filename) tensorflow.python.framework.errors_impl.NotFoundError: ./src/cpp/high_dim_filter.so: undefined symbol: _ZTIN10tensorflow8OpKernelE

What can we do?

xingtianxia1314 commented 5 years ago

I have the same problem with you.but I don't kown how to correct it. Mine is tensorflow0gpu-1.12,cuda-9.0,cudnn7.0.

DangDinhQuocTrung commented 5 years ago

I have the same problem with tensorflow-gpu 1.12 and keras 2.2.4, any solution?

Golbstein commented 5 years ago

I've the same problem. Also TF 1.12 , keras 2.2.4

Golbstein commented 5 years ago

Sorry for my ignorance, but why the hell this is necessary? Can't this layer be written in pure keras without strange files?

mjoppich commented 5 years ago

I guess the following should compile the library just fine ... remember to adapt pathes for your cases ;)

g++ -std=c++11 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC -I /usr/local/lib/python2.7/dist-packages/tensorflow/include -O2 -D_GLIBCXX_USE_CXX11_ABI=0 -I ~/.local/lib/python2.7/site-packages/tensorflow/include/external/nsync/public -L/usr/local/lib/python2.7/dist-packages/tensorflow -ltensorflow_framework

panfengli commented 5 years ago
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )

g++ -std=c++11 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2
cv-shiyanshi commented 5 years ago

@panfengli Could you tell me that where should I fixed using the follow code?Thank you!

TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )

g++ -std=c++11 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2

qchenclaire commented 5 years ago

@panfengli Could you tell me that where should I fixed using the follow code?Thank you!

TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )

g++ -std=c++11 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2

These can be run as terminal commands. I'm using tensorflow 1.10 and these commands removed the error for me

cv-shiyanshi commented 5 years ago

@qchenclaire Thank you so much,I solved it by your recommend. By the way,Could you tell me that where can I find the training of CRF-RNN used tensorflow?

zhilongjiang commented 5 years ago

I have the exactly same problem.

tensorflow-gpu 1.120 cuda 10.0.130 cudnn 7.3

JadBatmobile commented 5 years ago

@panfengli, your instructions apply only to the CPU implementation. I am getting this error on the GPU support branch as well.

Im running tensorflow 1.12.0

JadBatmobile commented 5 years ago

It turned out i actually had to modify:

` ifeq ($(TF_VERSION_GTE_1_4), 1)

     CFLAGS += -I$(TF_INC)/external/nsync/public
     LDFLAGS := -L$(TF_LIB) -ltensorflow_framework -L/usr/local/cuda/lib64 -lcuda -lcudart

else LDFLAGS := endif `

To: CFLAGS += -I$(TF_INC)/external/nsync/public LDFLAGS := -L$(TF_LIB) -ltensorflow_framework -L/usr/local/cuda/lib64 -lcuda -lcudart

JadBatmobile commented 5 years ago

it seemed like the conditional was not doing what it was supposed to be doing.. perhaps the parsing is wrong.. i really suck and writing MakeFiles

skq-5233 commented 4 years ago

Hello! When I run the sh.compile.sh command, it compiles successfully, but when I run train.py, I get an error: undefined symbol:_ZTIN10tensorflow8opkernelE. I checked a lot of information on the Internet and did not solve it. Hope you help me see what is the problem. Thanks again! ! ! ubuntu :16.04 ; nvidia-driver-440;cuda:10.0; cudnn:7.5.0; tensorflow-gpu:1.13.1; gcc/g++:5.4.0; image

@qchenclaire @zhilongjiang

skq-5233 commented 4 years ago

The last step, run_demo.py, I get this error:

Traceback (most recent call last): File "run_demo.py", line 27, in from crfrnn_model import get_crfrnn_model_def File "./src/crfrnn_model.py", line 28, in from crfrnn_layer import CrfRnnLayer File "./src/crfrnn_layer.py", line 28, in import high_dim_filter_loader File "./src/high_dim_filter_loader.py", line 28, in custom_module = tf.load_op_library(os.path.join(os.path.dirname(file), 'cpp', 'high_dim_filter.so')) File "/home/fu/.local/share/virtualenvs/my_pipenv-ITNpTMim/lib/python3.5/site-packages/tensorflow/python/framework/load_library.py", line 60, in load_op_library lib_handle = py_tf.TF_LoadLibrary(library_filename) tensorflow.python.framework.errors_impl.NotFoundError: ./src/cpp/high_dim_filter.so: undefined symbol: _ZTIN10tensorflow8OpKernelE

What can we do? Hello, may I ask how this problem was finally solved?Thank you very much!

skq-5233 commented 4 years ago

@panfengli Could you tell me that where should I fixed using the follow code?Thank you! TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') ) g++ -std=c++11 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2

These can be run as terminal commands. I'm using tensorflow 1.10 and these commands removed the error for me

@panfengli Could you tell me that where should I fixed using the follow code?Thank you! TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') ) g++ -std=c++11 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2

These can be run as terminal commands. I'm using tensorflow 1.10 and these commands removed the error for me

Hello, may I ask how this problem was finally solved?Thank you very much!

skq-5233 commented 4 years ago

I have the same problem with you.but I don't kown how to correct it. Mine is tensorflow0gpu-1.12,cuda-9.0,cudnn7.0.

Hello! How did you finally solve the problem.Thanks a lot!!

skq-5233 commented 4 years ago

@panfengli Could you tell me that where should I fixed using the follow code?Thank you! TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') ) g++ -std=c++11 -shared high_dim_filter.cc modified_permutohedral.cc -o high_dim_filter.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2

These can be run as terminal commands. I'm using tensorflow 1.10 and these commands removed the error for me

Hello! How did you finally solve the problem.Thanks a lot!!