The example code to which you provide a hyperlink is from Feb 2018 and is intended for Tensorflow 1.x
However, Tensorflow released version 2.0 in fall 2019, which is at times incompatible with code written for Tensorflow 1.x
Google colab automatically loads the latest package versions and therefore loads Tensorflow 2.2 if you don't specify anything else in you colab notebook.
The code executed to Google colab is therefore incompatible with loaded libraries, therefore causing your error.
Add the following command at top of you Google colab notebook in order for it to load a specific version of Tensorflow:
!pip install tensorflow==1.15.2
Your colab notebook should now work, as I demonstrated here: