rohitgirdhar/AttentionalPoolingAction

undefined symbol: _ZN2cv3Mat10deallocateEv

Closed this issue · 9 comments

~/AttentionalPoolingAction-master/src$ python eval.py --cfg ../experiments/003_MPII_ResNet_withPoseAttention_pretrained.yaml
Traceback (most recent call last):
File "eval.py", line 28, in
from preprocess_pipeline import get_input
File "/home/cyf/AttentionalPoolingAction-master/src/preprocess_pipeline.py", line 2, in
from custom_ops.custom_ops_factory import pose_to_heatmap, render_pose,
File "/home/cyf/AttentionalPoolingAction-master/src/custom_ops/custom_ops_factory.py", line 12, in
os.path.join(ROOT_PATH, 'pose_to_heatmap.so')).pose_to_heatmap
File "/home/cyf/miniconda2/lib/python2.7/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: /home/cyf/AttentionalPoolingAction-master/src/custom_ops/pose_to_heatmap.so: undefined symbol: _ZN2cv3Mat10deallocateEv

After compiling some custom_ops, I got this error when i try to eval.
What should i do?
Is there anything i should edify in src/cumtom_ops/Makefile?
Thanks a lot

It seems somehow opencv is not getting linked correctly. Maybe look at this answer

Similar issue here,
when running train.py, I receive the similar issue from tensorflow/python/framework/load_library.py

Opencv libs have been added to the system path.

Any updates?

Did you try ldd .../pose_to_heatmap.so?

ldd pose_to_heatmap.so:
linux-vdso.so.1 => (0x00007fff6f7c3000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f940c783000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f940c56c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f940c1a3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f940be9d000)
/lib64/ld-linux-x86-64.so.2 (0x000056333169f000)

It did show any "not found" information.
My system is Ubuntu 14.04 LTS with opencv 2.4.8.

I solved the problem by adding the following compiler flags:

  1. Add "--no-as-needed" to the LDFLAGS

  2. My gcc version is 5.4, it also gives the following error:
    "undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringB5cxx11Ev"
    Turns out, I also need to add "-D_GLIBCXX_USE_CXX11_ABI=0" to LDFLAGS

This worked for me!
It saved me a lot of time, thank you and the owner

After adding "-D_GLIBCXX_USE_CXX11_ABI=0" to LDFLAGS, again getting the error "undefined symbol: _ZTIN10tensorflow8OpKernelE", though I have added -L$(TF_LIB) -ltensorflow_framework to the Makefile with which the error had disappeared before, but facing the same error again. Can anyone help with this.

Thanks.

I am using tf1.4 for which I am getting the error. I also tried with tf1.1 but running into multiple cuda issues. Hence, I will prefer if the above error can be somehow solved for tf1.4.

Thanks.

It got solved for tf1.4 after adding paths in ~/.bashrc file.