0

I am going through a lab walkthrough done by Google Cloud about Transformer and BERT Models and I am working in a JupyterLab notebook and using TensorFlow 2.10.

One of the modules I am trying to call is from official.nlp import optimization (I linked the video at exactly the time where they go over import statements).

My problem is that I keep getting an error which says that there is no such module as "official", even when I have successfully installed it on my command prompt.

I already tried to do !pip install -U tf-models-official==2.10 but the error still remains.

I have no idea what to do. I was facing the same issues with another import statement, import tensorflow_text as text, but I fixed it by doing !pip install -U tensorflow_text==2.10. I took inspiration from this to try to fix my error on "official", but it still doesn't work.

  • Hi @Shayaan Uddin, I tried replicating the code and found the same error. But error got resolved when I dont specify any version while installing tf-models-officials, which will also install supporting tensorflow-text as dependency with latest version and use this code as well `import from tensorflow_models import nlp`. Please check this [gist](https://colab.research.google.com/gist/RenuPatelGoogle/75776bc9521a6f77449bba90c71160eb/76527755.ipynb) for the reference. – TF_Renu Patel Jul 17 '23 at 07:25

0 Answers0