How to Find Which Version of Tensorflow Is Installed in My System

How to find which version of TensorFlow is installed in my system?

This depends on how you installed TensorFlow. I am going to use the same headings used by TensorFlow's installation instructions to structure this answer.


Pip installation

Run:

python -c 'import tensorflow as tf; print(tf.__version__)'  # for Python 2
python3 -c 'import tensorflow as tf; print(tf.__version__)' # for Python 3

Note that python is symlinked to /usr/bin/python3 in some Linux distributions, so use python instead of python3 in these cases.

pip list | grep tensorflow for Python 2 or pip3 list | grep tensorflow for Python 3 will also show the version of Tensorflow installed.


Virtualenv installation

Run:

python -c 'import tensorflow as tf; print(tf.__version__)'  # for both Python 2 and Python 3

pip list | grep tensorflow will also show the version of Tensorflow installed.

For example, I have installed TensorFlow 0.9.0 in a virtualenv for Python 3. So, I get:

$ python -c 'import tensorflow as tf; print(tf.__version__)'
0.9.0

$ pip list | grep tensorflow
tensorflow (0.9.0)

How do I find out the version of TensorFlow on my computer?

import tensorflow as tf
tf.__version__

How to check which version of Keras is installed?

Python library authors put the version number in <module>.__version__. You can print it by running this on the command line:

python -c 'import keras; print(keras.__version__)'

If it's Windows terminal, enclose snippet with double-quotes like below

python -c "import keras; print(keras.__version__)"

How to find the Bazel version currently in my system via command prompt code or some other ways for Tensorflow installation

Running:

bazel --version

Will tell you which version of bazel is installed (and in search PATH) on your system.

For ensuring use of correct / consistent version of bazel across the board, it may be helpful to use bazelisk as a front to bazel which also honors the .bazelversion file in the current dir or its parents (if present, as it is in the tensorflow tree ; that would normally translate to, within the bazel workspace) and runs (downloads if needed) corresponding bazel.



Related Topics



Leave a reply



Submit