text: tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow_text/python/metrics/_text_similarity_metric_ops.so: undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb

Hello!

Could you please help me with this issue? I am using tensorflow image from docker hub tensorflow==2.3.0 My Dockerfile looks like this:

image

Locally I installed tensorflow==2.3.0 and tensorflow-text==2.3.0 and everything works fine. But when I am using docker image + tensorflow_text I get this issue.

This is my full log: File "", line 3, in <module> import tensorflow_text File "/usr/local/lib/python3.6/dist-packages/tensorflow_text/__init__.py", line 21, in <module> from tensorflow_text.python import metrics File "/usr/local/lib/python3.6/dist-packages/tensorflow_text/python/metrics/__init__.py", line 20, in <module> from tensorflow_text.python.metrics.text_similarity_metric_ops import * File "/usr/local/lib/python3.6/dist-packages/tensorflow_text/python/metrics/text_similarity_metric_ops.py", line 28, in <module> gen_text_similarity_metric_ops = load_library.load_op_library(resource_loader.get_path_to_datafile('_text_similarity_metric_ops.so')) File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/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: /usr/local/lib/python3.6/dist-packages/tensorflow_text/python/metrics/_text_similarity_metric_ops.so: undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

This error normally shows when TF is has a separate ABI than the TensorFlow that TF.Text was built against. If in this docker image you reinstall TensorFlow using pip (pip install -U tensorflow==2.3.0), do you continue to get this error?

@mihaimaruseac Nope… still need do pip install -U tensorflow==2.3.0

This issue seems not yet resolved with the following error:

`>>> import tensorflow as tf Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/home/tensorflow/.local/lib/python3.6/site-packages/tensorflow/init.py”, line 436, in <module> _ll.load_library(_main_dir) File “/home/tensorflow/.local/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py”, line 153, in load_library py_tf.TF_LoadLibrary(lib) tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow/core/kernels/libtfkernel_sobol_op.so: undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb

Still need to run pip install -U tensorflow==2.3.0 for the docker image. `

Dockerfile needs to be updated ASAP. Why is this issue closed ?

@Azharazzu same error here (it works on Mac)

pip install -U tensorflow==2.5.1
git clone -b v2.5.1 --depth 1 https://github.com/lifeiteng/text.git
cd text
./oss_scripts/run_build.sh
pip install tensorflow_text-*-cp38-cp38-linux_x86_64.whl
cd ..
python -c"import tensorflow_text as tftxt"

error on Linux FROM nvidia/cuda:11.3.0-cudnn8-runtime-ubuntu20.04

2021-10-28 11:22:42.400503: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/tensorflow_text/__init__.py", line 21, in <module>
    from tensorflow_text.python import metrics
  File "/usr/local/lib/python3.8/dist-packages/tensorflow_text/python/metrics/__init__.py", line 20, in <module>
    from tensorflow_text.python.metrics.text_similarity_metric_ops import *
  File "/usr/local/lib/python3.8/dist-packages/tensorflow_text/python/metrics/text_similarity_metric_ops.py", line 28, in <module>
    gen_text_similarity_metric_ops = load_library.load_op_library(resource_loader.get_path_to_datafile('_text_similarity_metric_ops.so'))
  File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/framework/load_library.py", line 58, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python3.8/dist-packages/tensorflow_text/python/metrics/_text_similarity_metric_ops.so: undefined symbol: _ZNK10tensorflow8OpKernel11TraceStringB5cxx11ERKNS_15OpKernelContextEb