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

tf2.16.1 isn't compatibale with tensorflow text 2.10 #1985

Open
deutschoo opened this issue Nov 14, 2024 · 2 comments
Open

tf2.16.1 isn't compatibale with tensorflow text 2.10 #1985

deutschoo opened this issue Nov 14, 2024 · 2 comments
Assignees

Comments

@deutschoo
Copy link

Describe the bug
import tensorflow_text

ImportError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_17348\101723867.py in
----> 1 import tensorflow_text

C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_text_init_.py in
18
19 # pylint: disable=wildcard-import
---> 20 from tensorflow_text.core.pybinds import tflite_registrar
21 from tensorflow_text.python import keras
22 from tensorflow_text.python import metrics

ImportError: DLL load failed while importing tflite_registrar:

TypeError: Error when deserializing class 'CLIPTokenizer' using config={'name': 'clip_l_tokenizer', 'trainable': True, 'dtype': 'int32', 'config_file': 'clip_l_tokenizer.json', 'sequence_length': None, 'add_prefix_space': False, 'pad_with_end_token': True}.

Exception encountered: CLIPTokenizer requires tensorflow and tensorflow-text for text processing. Run pip install tensorflow-text to install both packages or visit https://www.tensorflow.org/install

If tensorflow-text is already installed, try importing it in a clean python session. Your installation may have errors.

KerasHub uses tf.data and tensorflow-text to preprocess text on all Keras backends. If you are running on Jax or Torch, this installation does not need GPU support.

During handling of the above exception, another exception occurred:

tensorflow text 2.16.1 is not available in windows。

Would you like to help us fix it?

@mattdangerw
Copy link
Member

tensorflow-text and tensorflow should always be on the exact same version; the tensorflow-text c++ code is built and linked against the tensorflow c++ code.

For windows, the best approach for 99% of users will be to go with WSL and install the packages in WSL. You might be able to pick an older version of tensorflow and tensorflow-text on windows, but tensorflow 2.15 is over a year old now so I wouldn't recommend it. You could also uninstall tensorflow entirely, but that would mean preprocessing would have to happen outside of KerasHub, which would make the package much harder to use.

The best experience will be on the newer versions of keras-hub, keras and tensorflow in a linux like environment, and WSL is a great option for that.

@deutschoo
Copy link
Author

deutschoo commented Nov 27, 2024 via email

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

3 participants