tensorflow / tensorflow/text

tensorflow-text not compatible with tensorflow-macos and tensorflow-metal

Open
#654 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

duplicate
Dominant language
C++
Stars
1.3k
Forks
379
Avg merge
3h 30m
Merged PRs (30d)
8

Description

I am able to get my AMD Radeon Pro 5700 XT gpu to run on an iMac 27" with Big Sur tensorflow with 2.5.

Screen Shot 2021-07-13 at 11 49 32 AM

If I add tensorflow-text, I get this exception:

% python
Python 3.8.2 (default, Apr  8 2021, 23:19:18) 
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/davidlaxer/tensorflow-metal/lib/python3.8/site-packages/tensorflow/__init__.py", line 449, in <module>
    _ll.load_library(_plugin_dir)
  File "/Users/davidlaxer/tensorflow-metal/lib/python3.8/site-packages/tensorflow/python/framework/load_library.py", line 154, in load_library
    py_tf.TF_LoadLibrary(lib)
tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/davidlaxer/tensorflow-metal/lib/python3.8/site-packages/tensorflow-plugins/libmetal_plugin.dylib, 6): Symbol not found: _TF_AssignUpdateVariable
  Referenced from: /Users/davidlaxer/tensorflow-metal/lib/python3.8/site-packages/tensorflow-plugins/libmetal_plugin.dylib
  Expected in: flat namespace

>>> 

Here's what was added with pip install tensorflow-text in the Python 3.8.2 virtual environment:

 pip install tensorflow_text
Collecting tensorflow_text
  Using cached tensorflow_text-2.5.0-cp38-cp38-macosx_10_9_x86_64.whl (3.6 MB)
Collecting tensorflow<2.6,>=2.5.0
  Using cached tensorflow-2.5.0-cp38-cp38-macosx_10_11_x86_64.whl (195.7 MB)
Collecting tensorflow-hub>=0.8.0
  Using cached tensorflow_hub-0.12.0-py2.py3-none-any.whl (108 kB)
Requirement already satisfied: tensorflow-estimator<2.6.0,>=2.5.0rc0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (2.5.0)
Requirement already satisfied: numpy~=1.19.2 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.19.5)
Requirement already satisfied: tensorboard~=2.5 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (2.5.0)
Requirement already satisfied: termcolor~=1.1.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.1.0)
Requirement already satisfied: opt-einsum~=3.3.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (3.3.0)
Requirement already satisfied: protobuf>=3.9.2 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (3.17.3)
Requirement already satisfied: flatbuffers~=1.12.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.12)
Requirement already satisfied: google-pasta~=0.2 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (0.2.0)
Requirement already satisfied: grpcio~=1.34.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.34.1)
Requirement already satisfied: astunparse~=1.6.3 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.6.3)
Requirement already satisfied: six~=1.15.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.15.0)
Requirement already satisfied: keras-preprocessing~=1.1.2 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.1.2)
Requirement already satisfied: typing-extensions~=3.7.4 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (3.7.4.3)
Requirement already satisfied: gast==0.4.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (0.4.0)
Requirement already satisfied: keras-nightly~=2.5.0.dev in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (2.5.0.dev2021032900)
Requirement already satisfied: absl-py~=0.10 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (0.12.0)
Requirement already satisfied: wrapt~=1.12.1 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (1.12.1)
Requirement already satisfied: h5py~=3.1.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (3.1.0)
Requirement already satisfied: wheel~=0.35 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorflow<2.6,>=2.5.0->tensorflow_text) (0.36.2)
Requirement already satisfied: google-auth<2,>=1.6.3 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (1.32.1)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (0.6.1)
Requirement already satisfied: requests<3,>=2.21.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (2.26.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (0.4.4)
Requirement already satisfied: werkzeug>=0.11.15 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (2.0.1)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (1.8.0)
Requirement already satisfied: setuptools>=41.0.0 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (41.2.0)
Requirement already satisfied: markdown>=2.6.8 in ./tensorflow-metal/lib/python3.8/site-packages (from tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (3.3.4)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./tensorflow-metal/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (0.2.8)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./tensorflow-metal/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (4.2.2)
Requirement already satisfied: rsa<5,>=3.1.4 in ./tensorflow-metal/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (4.7.2)
Requirement already satisfied: requests-oauthlib>=0.7.0 in ./tensorflow-metal/lib/python3.8/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (1.3.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in ./tensorflow-metal/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (0.4.8)
Requirement already satisfied: certifi>=2017.4.17 in ./tensorflow-metal/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in ./tensorflow-metal/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (3.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./tensorflow-metal/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (1.26.6)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./tensorflow-metal/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (2.0.1)
Requirement already satisfied: oauthlib>=3.0.0 in ./tensorflow-metal/lib/python3.8/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.5->tensorflow<2.6,>=2.5.0->tensorflow_text) (3.1.1)
Installing collected packages: tensorflow-hub, tensorflow, tensorflow-text
Successfully installed tensorflow-2.5.0 tensorflow-hub-0.12.0 tensorflow-text-2.5.0

Here's what the environment looked like before adding tensorflow-text:

r@x86_64-apple-darwin13 ~ % pip list
Package                  Version
------------------------ -------------------
absl-py                  0.12.0
appnope                  0.1.2
astunparse               1.6.3
attrs                    21.2.0
backcall                 0.2.0
cachetools               4.2.2
certifi                  2021.5.30
charset-normalizer       2.0.1
Cython                   0.29.23
debugpy                  1.3.0
decorator                5.0.9
dill                     0.3.4
flatbuffers              1.12
future                   0.18.2
gast                     0.4.0
google-auth              1.32.1
google-auth-oauthlib     0.4.4
google-pasta             0.2.0
googleapis-common-protos 1.53.0
grpcio                   1.34.1
h5py                     3.1.0
idna                     3.2
importlib-resources      5.2.0
ipykernel                6.0.1
ipython                  7.25.0
ipython-genutils         0.2.0
jedi                     0.18.0
jupyter-client           6.1.12
jupyter-core             4.7.1
keras-nightly            2.5.0.dev2021032900
Keras-Preprocessing      1.1.2
Markdown                 3.3.4
matplotlib-inline        0.1.2
numpy                    1.19.5
oauthlib                 3.1.1
opt-einsum               3.3.0
parso                    0.8.2
pexpect                  4.8.0
pickleshare              0.7.5
pip                      21.1.3
promise                  2.3
prompt-toolkit           3.0.19
protobuf                 3.17.3
ptyprocess               0.7.0
pyasn1                   0.4.8
pyasn1-modules           0.2.8
Pygments                 2.9.0
python-dateutil          2.8.1
pyzmq                    22.1.0
requests                 2.26.0
requests-oauthlib        1.3.0
rsa                      4.7.2
setuptools               41.2.0
six                      1.15.0
tensorboard              2.5.0
tensorboard-data-server  0.6.1
tensorboard-plugin-wit   1.8.0
tensorflow-datasets      4.3.0
tensorflow-estimator     2.5.0
tensorflow-macos         2.5.0
tensorflow-metadata      1.1.0
tensorflow-metal         0.1.1
termcolor                1.1.0
tornado                  6.1
tqdm                     4.61.2
traitlets                5.0.5
typing-extensions        3.7.4.3
urllib3                  1.26.6
wcwidth                  0.2.5
Werkzeug                 2.0.1
wheel                    0.36.2
wrapt                    1.12.1
zipp                     3.5.0

Here's with the environment looks like after installing tensorflow-text:

% pip list
Package                  Version
------------------------ -------------------
absl-py                  0.12.0
appnope                  0.1.2
astunparse               1.6.3
attrs                    21.2.0
backcall                 0.2.0
cachetools               4.2.2
certifi                  2021.5.30
charset-normalizer       2.0.1
Cython                   0.29.23
debugpy                  1.3.0
decorator                5.0.9
dill                     0.3.4
flatbuffers              1.12
future                   0.18.2
gast                     0.4.0
google-auth              1.32.1
google-auth-oauthlib     0.4.4
google-pasta             0.2.0
googleapis-common-protos 1.53.0
grpcio                   1.34.1
h5py                     3.1.0
idna                     3.2
importlib-resources      5.2.0
ipykernel                6.0.1
ipython                  7.25.0
ipython-genutils         0.2.0
jedi                     0.18.0
jupyter-client           6.1.12
jupyter-core             4.7.1
keras-nightly            2.5.0.dev2021032900
Keras-Preprocessing      1.1.2
Markdown                 3.3.4
matplotlib-inline        0.1.2
numpy                    1.19.5
oauthlib                 3.1.1
opt-einsum               3.3.0
parso                    0.8.2
pexpect                  4.8.0
pickleshare              0.7.5
pip                      21.1.3
promise                  2.3
prompt-toolkit           3.0.19
protobuf                 3.17.3
ptyprocess               0.7.0
pyasn1                   0.4.8
pyasn1-modules           0.2.8
Pygments                 2.9.0
python-dateutil          2.8.1
pyzmq                    22.1.0
requests                 2.26.0
requests-oauthlib        1.3.0
rsa                      4.7.2
setuptools               41.2.0
six                      1.15.0
tensorboard              2.5.0
tensorboard-data-server  0.6.1
tensorboard-plugin-wit   1.8.0
tensorflow               2.5.0
tensorflow-datasets      4.3.0
tensorflow-estimator     2.5.0
tensorflow-hub           0.12.0
tensorflow-macos         2.5.0
tensorflow-metadata      1.1.0
tensorflow-metal         0.1.1
tensorflow-text          2.5.0
termcolor                1.1.0
tornado                  6.1
tqdm                     4.61.2
traitlets                5.0.5
typing-extensions        3.7.4.3
urllib3                  1.26.6
wcwidth                  0.2.5
Werkzeug                 2.0.1
wheel                    0.36.2
wrapt                    1.12.1
zipp                     3.5.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the import failure in the reported Python 3.8.2 environment with tensorflow-text 2.5.0, tensorflow-macos 2.5.0, and tensorflow-metal 0.1.1. Compare the environment before and after installing tensorflow-text; done means importing tensorflow no longer raises the missing _TF_AssignUpdateVariable symbol error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.