Home > Back-end >  ModuleNotFoundError: No module named 'tensorflow.contrib' with jupyter notebook
ModuleNotFoundError: No module named 'tensorflow.contrib' with jupyter notebook

Time:06-29

So this is my error [ModuleNotFoundError: No module named 'tensorflow.contrib']

I'm using tensorflow 2.0.0 and python 3.6.9 when i downgrade the tensorflow version of the code doesn't work when i upgrade it the same thing happens . (i am using jupyter notebook)

I tried to downgrade tensorflow's version and vice versa .

This is the part of the code where i have the error

Please help i really can't find a solution.

CodePudding user response:

tensorflow.contrib is being removed in version 2.0, you therefore need version <= 1.14 to operate tflearn.

In the command line (not the notebook), conda install tensorflow=1.14 (or tensorflow-gpu=1.14 if you want GPU support ; or pip install rather than conda install depending on what you are used to do).

CodePudding user response:

tensorflow.contrib is being removed in version 2.0, you therefore need version <= 1.14 to operate tflearn (by the way, this is a TFlearn issue, not a tensorflow one).

In your case, I would consider moving to tensorflow (instead of tflearn) and using the tf.keras API, which provides the higher-level API tflearn aimed at offering in times when tf.keras was not out yet.

  • Related