tensorflow version check colab code example
Example 1: check tensorflow version
import tensorflow as tf
tf.__version__
Example 2: tf 1 compatible colab
Specifying the TensorFlow version
Running
import tensorflow
will import the default version (currently 2.x). You can use 1.x
by running a cell with the
%tensorflow_version 1.x
magic before you run import tensorflow.
Example 3: colab tensorflow version change
%tensorflow_version 1.x
import tensorflow
print(tensorflow.__version__)