How to find which version of TensorFlow is install

2019-01-16 03:06发布

The title says it all. I'm using Ubuntu 16.04 Long Term Support.

10条回答
霸刀☆藐视天下
2楼-- · 2019-01-16 03:50

Almost every normal package in python assigns the variable .__version__ or VERSION to the current version. So if you want to find the version of some package you can do the following

import a
a.__version__ # or a.VERSION

For tensorflow it will be

import tensorflow as tf
tf.VERSION

For old versions of tensorflow (below 0.10), use tf.__version__

BTW, if you are planning to install tf, install it with conda, not pip

查看更多
Animai°情兽
3楼-- · 2019-01-16 03:59

I installed the Tensorflow 0.12rc from source, and the following command gives me the version info:

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

The following figure shows the output:

enter image description here

查看更多
小情绪 Triste *
4楼-- · 2019-01-16 04:04

For python 3.6.2:

import tensorflow as tf

print(tf.VERSION)
查看更多
Bombasti
5楼-- · 2019-01-16 04:05

For Python 3.6.3:

import tensorflow as tf

print(tf.VERSION)
查看更多
登录 后发表回答