Build TF-Text by default with TensorFlow2 backend
See original GitHub issueIs 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:
- Created 3 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top GitHub Comments
TF-Text should be available by default starting 21.10. Give it a try once it is released.
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.