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

undefined symbol: _ZN10tensorflow12OpDefBuilder4AttrESs #293

Closed
ramreddyyasa opened this issue Feb 11, 2019 · 21 comments
Closed

undefined symbol: _ZN10tensorflow12OpDefBuilder4AttrESs #293

ramreddyyasa opened this issue Feb 11, 2019 · 21 comments

Comments

@ramreddyyasa
Copy link

ramreddyyasa commented Feb 11, 2019

Hi ,
When I am trying to import "tf_sentencepiece" . I am getting following error:

NotFoundError Traceback (most recent call last)
in
import tf_sentencepiece as tfs

~/.conda/envs/tf_gpu/lib/python3.6/site-packages/tf_sentencepiece/init.py in
from future import print_function
from tf_sentencepiece.sentencepiece_processor_ops import *
~/.conda/envs/tf_gpu/lib/python3.6/site-packages/tf_sentencepiece/sentencepiece_processor_ops.py in
_gen_sentencepiece_processor_op = tf.load_op_library(so_file)
~/.conda/envs/tf_gpu/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py in load_op_library(library_filename)
RuntimeError: when unable to load the library or get the python wrappers.
"""
lib_handle = py_tf.TF_LoadLibrary(library_filename)
op_list_str = py_tf.TF_GetOpList(lib_handle)
NotFoundError: /home/user/.conda/envs/tf_gpu/lib/python3.6/site-packages/tf_sentencepiece/_sentencepiece_processor_ops.so.1.12.0: undefined symbol: _ZN10tensorflow12OpDefBuilder4AttrESs

Help me out in resolving this issue.
Thanks in advance.

@taku910
Copy link
Collaborator

taku910 commented Feb 11, 2019

tf_sentencepiece is built with the official tensorflow pypi package. The latest version is 1.12.0.

Seems that the tensorflow you are using now is not the official pypi release. How did you install tensorflow?

@ramreddyyasa
Copy link
Author

ramreddyyasa commented Feb 12, 2019

@taku910 I have installed tensorflow using below command
" conda install tensorflow-gpu "
and version of tensorflow installed is " 1.12.0"

@veqtor
Copy link

veqtor commented May 8, 2019

I've made some more research into this and it seems you need to install the specific build (arch, GCC-ver etc) for sentencepiece to work.
I'm out of luck since I'm using to Azure
Think we will have to switch to PyTorch, not giving in to Google's enforcement to use their cloud infrastructure just to get bpe-transformers to work :/

I don't understand why this isn't a core TF op if it's so universally used???

Also, are saved_model that depend on sentence_piece code even portable?

@shuiruge
Copy link

I got the same problem. My TF version is 1.13.1, installed by conda install tensorflow. My Python version is 3.6.0, anaconda on Centos 7. Is there any help?

@shuiruge
Copy link

I have solved this problem with the aid of Docker, simply using an official tensorflow runtime as a parent image. Explicitly, within the Dockerfile, write FROM tensorflow/tensorflow:latest-py3.

@DebanjanaKar
Copy link

@ramreddyyasa Did you find a solution? I am stuck with the same problem.

@redsk
Copy link

redsk commented Jul 11, 2019

I have the same problem. tensorflow-gpu, sentencepiece and tf-sentencepiece installed from pip. Python 3.7. I tried with both tensorflow-gpu==1.13.1 and tensorflow-gpu==1.14.0.

@redsk
Copy link

redsk commented Jul 12, 2019

I was able to make it work by setting -D_GLIBCXX_USE_CXX11_ABI=1 in make_py_wheel.sh.

@xjellyx
Copy link

xjellyx commented Aug 14, 2019

i have the same proplem , should be tesorflow environmental factors

@xjellyx
Copy link

xjellyx commented Aug 14, 2019

I solved the problem and changed the python version to 3.6.9.

@taku910
Copy link
Collaborator

taku910 commented Aug 17, 2019

Just updated tf_sentencepiece. You can install it via pip install tf_sentencepiece.

https://github.com/google/sentencepiece/releases/tag/v0.1.83

@taku910 taku910 closed this as completed Aug 17, 2019
@mhajiaghayi
Copy link

@taku910 , I just got the latest tf_sentencepiece and the the above problem still exists. i'm running py 3.6.9 and tf 1.14 on linux

@mhajiaghayi
Copy link

I solved the problem and changed the python version to 3.6.9.

how did you exactly solve this issue? are you using tf 1.14?

@urekalion
Copy link

@mhajiaghayi
I had the same problem, ubuntu 16.04,
my problem is mismatched gcc version between tensorflow(conda) and tf-sentencepiece.
ubuntu gcc version 5.4.0, conda gcc version is higher than ubuntu gcc version.

I solved the problem by this flow

  1. i removed conda3 and i installed anaconda2
  2. conda activate and conda install tensorflow-gpu (because install dependency)
  3. pip install tensorflow-gpu (overwrite)
  4. pip install sentencepiece tf-sentencepiece

@dsunjka
Copy link

dsunjka commented Sep 18, 2019

Had the same problem today and solved it by:

conda create -n "tensorflow" python=3.6.9
conda activate tensorflow
conda install pip
pip install tensorflow-gpu
pip install sentencepiece tf-sentencepiece tensorflow-hub

Setting python=3.6.9 was the most important thing. Changing versions of the libraries did not help, as some others reported already.

Ubuntu 16.04, Anaconda 5

@Miraclemarvel55
Copy link

那是conda 的问题,我换成pip 安装 tensorflow 就没问题.

@taichuai
Copy link

taichuai commented Apr 5, 2020

那是conda 的问题,我换成pip 安装 tensorflow 就没问题.

me too。。

@Heeyyy
Copy link

Heeyyy commented Oct 18, 2020

那是conda 的问题,我换成pip 安装 tensorflow 就没问题.

哇谢谢老哥,解决了!

@sergiomora03
Copy link

@taku910 , I just got the latest tf_sentencepiece and the the above problem still exists. i'm running py 3.6.9 and tf 1.14 on linux

@taku910 Actually i´m running in Google Colab and I get the same issue. Can you help me?

@asunyz
Copy link

asunyz commented Dec 7, 2020

那是conda 的问题,我换成pip 安装 tensorflow 就没问题.

Thanks so much!

@Jijun
Copy link

Jijun commented Apr 1, 2022

thanks , conda 误我

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