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!

Leave a Comment