tensorflow / tensorflow/text

Tensorflow importing problem in Google colab

Open
#1,259 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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.

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 sequence in Google Colab and recording the installed versions of tensorflow, tensorflow_hub, and tensorflow_text. Inspect the reported tf_keras/src/saving/legacy/saved_model/load_context.py traceback; done means the imports no longer raise the reported AttributeError or the incompatible version combination is clearly identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
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.