Check TensorFlow version

Ads
 

Check TensorFlow version

How you can Check TensorFlow version?

How you can Check TensorFlow version?

Check TensorFlow version - How to check TensorFlow version?

In this tutorial we will learn how to check the version of TensorFlow machine learning library installed on my computer? If you are using TensorFlow for developing your program and want to check the version of TensorFlow installed on your computer then you use the code explained here.

There are lot of change coming in each version of TensorFlow and you should choose the right version to run your deep learning program. So, it becomes necessary to check TensorFlow version in your program.

This tutorial shows you how to find which version of TensorFlow is installed in your system by printing it on the console. Firsts of all I am assuming that you have Python on your system and TensorFlow is already installed in Python environment.

If you have already installed TensorFlow then open the Python prompt and type:


import tensorflow as tf

This code should run without any error. If it throws error then its means TensorFlow is not installed in your system.

Now type following code to see the version of TensorFlow installed on your system.


import tensorflow as tf
print(tf.__version__)

In my system TensorFlow 2.0.0 is installed and it shows following output:


2.0.0

Here is screen shot from Google Colab environment:

Check TensorFlow version

You run this command on the Python prompt on your system to see the TensorFlow version installed in your system.

In  Windows 10 you can open the cmd terminal and type pyton to open the python terminal. In the python terminal you can write following code to print the version of TensorFlow:


import tensorflow as tf
print(tf.__version__)

Here is output on Windows 10 computer:


C:\Deepak\Dell>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> print(tf.__version__)
1.6.0

On the windows machine following output is displayed:

checking tensorflow version on windows10

In this tutorial we have learned how to find out the version of TensorFlow installed on my system.

Here are more tutorials to learn TensorFlow 2.0:

Ads

Ads