'How to downgrade the tensorflow version when using google colaboratory?

I am a noob in tensorflow. I am getting the following error.

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

I know this occurs as tesorflow 2.0 does not support contrib. i have tried adding the following into the first cell of the online google colab note book. But it did not work.

%tensorflow_version 1.x

Please bear with me as I am completely new to this.

What Can I do with this?



Solution 1:[1]

You have to first uninstall tensorflow:

!pip uninstall tensorflow

And then reinstall the version you want:

!pip install tensorflow==1.15.5

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 zaki98