question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build TF-Text by default with TensorFlow2 backend

See original GitHub issue

Is your feature request related to a problem? Please describe. TF-Text extends the base TensorFlow operations to text manipulation. These are very useful for BERT-like models.

However, when we load a TF model with these operations, we get the following error:

2021-01-22 18:22:14.293027: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:607] function_optimizer failed: Not found: Op type not registered 'CaseFoldUTF8'; in binary running on f611a6b8b90b. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.

Describe the solution you’d like It would be great if these core extensions are built by default into the TensorFlow2 backend.

Describe alternatives you’ve considered I have tried to install TensorFlow-Text with a simple pip command:

ARG TRITON_VERSION=20.12
FROM nvcr.io/nvidia/tritonserver:${TRITON_VERSION}-py3
RUN pip install tensorflow-text==2.3.0

This ends up installing TensorFlow 2.3.2 again.

Successfully installed absl-py-0.11.0 astunparse-1.6.3 cachetools-4.2.0 certifi-2020.12.5 chardet-4.0.0 gast-0.3.3 google-auth-1.24.0 google-auth-oauthlib-0.4.2 google-pasta-0.2.0 h5py-2.10.0 idna-2.10 keras-preprocessing-1.1.2 markdown-3.3.3 numpy-1.18.5 oauthlib-3.1.0 opt-einsum-3.3.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.25.1 requests-oauthlib-1.3.0 rsa-4.7 tensorboard-2.4.1 tensorboard-plugin-wit-1.8.0 tensorflow-2.3.2 tensorflow-estimator-2.3.0 tensorflow-text-2.3.0 termcolor-1.1.0 urllib3-1.26.2 werkzeug-1.0.1 wrapt-1.12.1

Inference continues to fail with the same error message. My best guess is that the installed ops are not in the right directory.

Additional context If there is another way to install TensorFlow-Text, please let me know!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tanmayv25commented, Oct 18, 2021

TF-Text should be available by default starting 21.10. Give it a try once it is released.

0reactions
JoshuaPostelcommented, Oct 7, 2021

Also experiencing this issue. A large number of models on TensorFlow Hub require TF-Text. If anyone has success with the custom operation approach, it would be great to hear.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf.keras.backend.set_floatx | TensorFlow v2.11.0
Sets the default float type.
Read more >
Building models with tf.text (TF World '19) - YouTube
There are many resources for building models from numeric data, which meant processing text had to occur outside the model.
Read more >
Redundancies in tf.keras.backend and tensorflow libraries
I understand that the transition to TF 2.0 is supposed to remove a lot of redundancies in modeling and building graphs, since there...
Read more >
Building models with tf.text · All things
An important step in building a model is Text preprocessing which consist of: tokenization, i.e. extracting tokens from the original text ...
Read more >
Why does Keras need TensorFlow as backend?
I am not getting correct directions on why we need Keras. We can use TensorFlow to build a neural network model, but why...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found