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

Tensorflow importing problem in Google colab #1259

Open
Error-IAN opened this issue Mar 13, 2024 · 1 comment
Open

Tensorflow importing problem in Google colab #1259

Error-IAN opened this issue Mar 13, 2024 · 1 comment

Comments

@Error-IAN
Copy link

When i try to import tensorflow_hub with tensorflow_text,I get attribute error for tensorflow_hub.The error looks like:
AttributeError Traceback (most recent call last)
in <cell line: 2>()
1 import tensorflow as tf
----> 2 import tensorflow_hub as hub
3 import tensorflow_text as text

13 frames
/usr/local/lib/python3.10/dist-packages/tf_keras/src/saving/legacy/saved_model/load_context.py in
66
67
---> 68 tf.internal.register_load_context_function(in_load_context)
69

AttributeError: module 'tensorflow._api.v2.compat.v2.internal' has no attribute 'register_load_context_function'.

I have upgrade tensorflow,uninstalled it again but I am getting this error over and over again.I have also changed the running type from cpu to gpu and tpu.But nothing seems to working.

@LuMa342
Copy link

LuMa342 commented Mar 15, 2024

I had the same problem. Fixed it by using a previous version of tensorflow-text

!pip install tensorflow-text==2.15.0

I think it's from keras version used by colab that is not compatible with latest tensorflow (version must be below 2.16 and above 2.15 but newest is currently 2.16.1). Not an expert thought, hope it helps

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

2 participants