Why can I not import Tensorflow.contrib I get an error of No module named ‘tensorflow.python.saved

Why can I not import Tensorflow.contrib I get an error of No module named ‘tensorflow.python.saved

For anyone who is trying some old codes from github with Tensorflow 1.x.x versions while having Tensorflow 2.0.x please note that tf.contrib no longer exist in Tensorflow 2.0.x and it’s modules were moved.
Please google the name of the module without the tf.contrib part to know it’s new location and thus migrating your code accordingly by correcting the import statement.

Hope this helped!

Why can I not import Tensorflow.contrib I get an error of No module named ‘tensorflow. python. saved

first unistall tensorflow

pip uninstall tensorflow

then install 1.13.2 version

pip install tensorflow==1.13.2

it works.. had the same issue.. but installing tensorflow 1.13.2 solved it!
the newer version of tensorflow doesn’t have

Why can I not import Tensorflow.contrib I get an error of No module named ‘tensorflow.python.saved

I solved this by below method.

  pip uninstall tensorflow_estimator
  pip install tensorflow_estimator

the reference is : https://github.com/tensorflow/tensorflow/issues/27079

Leave a Reply

Your email address will not be published.