afshar
afshar

Reputation: 11

ModuleNotFoundError: No module named 'tensorflow.contrib'

I cannot use edward package on google cola.

I have the below error:

ModuleNotFoundError Traceback (most recent call last) in () ----> 1 import edward

4 frames /usr/local/lib/python3.6/dist-packages/edward/models/dirichlet_process.py in () 6 7 from edward.models.random_variable import RandomVariable ----> 8 from tensorflow.contrib.distributions import Distribution 9 10 try:

ModuleNotFoundError: No module named 'tensorflow.contrib'


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the

"Open Examples" button below.

Upvotes: 1

Views: 1402

Answers (1)

blissfulProgrammer
blissfulProgrammer

Reputation: 23

Uninstalling current/latest version of tensorflow and installing version 1.14 resolved it for me. Looks like they removed tensorflow.contrib from tensorflow version >1.14.

!pip uninstall tensorflow
!pip install tensorflow==1.14

Upvotes: 1

Related Questions