28

What's the command to find out the version of TensorFlow on my computer? I installed TensorFlow on my computer some time ago and want to make sure that I have the latest version.

David293836
  • 1,165
  • 2
  • 18
  • 36
  • 4
    Possible duplicate of [How to find which version of TensorFlow is installed in my system?](https://stackoverflow.com/questions/38549253/how-to-find-which-version-of-tensorflow-is-installed-in-my-system) – nbro Nov 18 '17 at 11:52

7 Answers7

61
import tensorflow as tf
tf.__version__
Yaroslav Bulatov
  • 57,332
  • 22
  • 139
  • 197
  • 1
    Something you might run into doing this is an error that says "ImportError: cannot import name pywrap_tensorflow". You're likely just running Python from the Tensorflow directory. Just switch to a different directory, and it should work. – smckee Feb 24 '17 at 21:57
  • 5
    Can we find out if the GPU/CPU version is installed? – Mohammad Jun 05 '17 at 11:44
15
pip list | grep tensorflow

You can find the version of any installed library by replacing 'tensorflow' with the library name.

OmK
  • 147
  • 2
  • 9
10
$ pip show tensorflow
Name: tensorflow
Version: 1.5.0
Summary: TensorFlow helps the tensors flow
Trideep Rath
  • 3,623
  • 1
  • 25
  • 14
3
$ source activate tensorflow
$ pip show tensorflow
Name: tensorflow
Version: 1.9.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
user365
  • 31
  • 1
  • 1
    Welcome to posting on Stack Overflow. Thanks for your answer. But please try to refrain from making code only (or command only) answers. [How to Answer](https://stackoverflow.com/help/how-to-answer) – Elletlar Jul 22 '18 at 20:35
3

Use the below code In jupyter-Notebook/Pycharm to check the tensorflow version.

import tensorflow as tf

print(tf.version.VERSION)
Amar Kumar
  • 2,392
  • 2
  • 25
  • 33
0

You can try this:

pip freeze|grep tensorflow
CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
0
$ import tensorflow as tf
$ tf.test.is_built_with_cuda()
True
$ tf.test.is_gpu_available(cuda_only=False, min_cuda_compute_capability=None)
False
Felix Schwarz
  • 2,938
  • 4
  • 28
  • 41