9951 explained code solutions for 126 technologies


python-tensorflowHow do I get the version of Python TensorFlow I'm using?


To get the version of Python TensorFlow you are using, you can use the following code block:

import tensorflow as tf
print(tf.__version__)

This will output the version of TensorFlow you are currently using, e.g. 2.2.0.

The code block consists of the following parts:

  1. import tensorflow as tf: This imports the tensorflow module as tf, so that you can access its functions and attributes.
  2. print(tf.__version__): This prints the version of TensorFlow you are currently using.

Helpful links

Edit this code on GitHub