No module named'tensorflow.models'

I’m working on some work for my first chatbot

from tensorflow.models.rnn.translate import seq2seq_model

I get an error when I try to run a “.py” that contains

Traceback (most recent call last):
   File "translate.py", line 29, in <module>
     from tensorflow.models.rnn.translate import seq2seq_model
ModuleNotFoundError: No module named'tensorflow.models'

Is there a way to solve this?

What tutorial/doc are you using?

I was reading an old reference

I’m trying T2T now
Replace the path with your Cent7 and proceed

But the error

AttributeError: module'tensorflow' has no attribute'logging'

These two tutorials rely on old TF (EOL) versions.

1 Like

there’s this newer tutorial to do seq2seq that might be helpful here: Neural machine translation with attention  |  Text  |  TensorFlow

2 Likes

As he was playing with chatbots do you know what Is the official alternative to:

not from the top of my head. I think the easiest would be to adapt that tutorial to use a Transformer from TFHub.
That would be an interesting project.
one problem is that from the blog post, the colab is giving 404, I guess it was moved

It was deprecated with:

The commit claimed that the community folder general replacement is https://devlibrary.withgoogle.com/

1 Like

I didn’t know about this url!
Thanks for sharing, lot’s of cool stuff!

Hi,

Can you check the version of tensorflow installed in your system. If you are using the old version, I would recommend to update your tensorflow to updated versions. You can try with Tensorflow > 2.2 version. You can install by the following command:
pip install tensorflow==2.2.1

If you still face the issue, please do the following things:

  1. Check your python version, it should be greater than 3.6
  2. Check with virtual environment
  3. In case still face issue try once with google colab, if it works it means there is some issue with your OS, so in local machine may be you can try your codes once in linux environment.

I hope this will solve your problem.
Thanks