Programing

시스템에 설치된 TensorFlow 버전을 찾는 방법은 무엇입니까?

lottogame 2020. 5. 15. 07:57
반응형

시스템에 설치된 TensorFlow 버전을 찾는 방법은 무엇입니까?


제목이 다 나와 있습니다. 우분투 16.04 장기 지원을 사용하고 있습니다.


이것은 TensorFlow 설치 방법에 따라 다릅니다. 이 답변을 구성 하기 위해 TensorFlow의 설치 지침 에서 사용 된 것과 동일한 제목을 사용합니다 .


핍 설치

운영:

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

참고 python로 심볼릭 링크되어 /usr/bin/python3일부 Linux 배포판에, 그래서 사용하는 python대신 python3이러한 경우.

pip list | grep tensorflowPython 2 또는 pip3 list | grep tensorflowPython 3의 경우 설치된 Tensorflow 버전도 표시됩니다.


Virtualenv 설치

운영:

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

pip list | grep tensorflow 설치된 Tensorflow 버전도 표시됩니다.

예를 들어 virtualenvPython 3의 경우 TensorFlow 0.9.0을 설치했습니다 .

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

$ pip list | grep tensorflow
tensorflow (0.9.0)

파이썬의 거의 모든 일반 패키지는 변수 .__version__또는 VERSION현재 버전을 할당합니다 . 따라서 일부 패키지의 버전을 찾으려면 다음을 수행 할 수 있습니다

import a
a.__version__ # or a.VERSION

텐서 플로우의 경우

import tensorflow as tf
tf.VERSION

이전 버전의 tensorflow (0.10 미만)의 경우 tf.__version__

BTW, tf를 설치할 계획이라면 pip가 아닌 conda로 설치하십시오.


import tensorflow as tf

print(tf.VERSION)

pip를 통해 설치 한 경우 다음을 실행하십시오.

$ pip show tensorflow
Name: tensorflow
Version: 1.5.0
Summary: TensorFlow helps the tensors flow

파이썬의 아나콘다 배포판을 사용한다면

$ conda list | grep tensorflow
tensorflow    1.0.0       py35_0    conda-forge

Jupyter Notebook (IPython Notebook)을 사용하여 확인하려면

In [1]: import tensorflow as tf
In [2]: tf.__version__
Out[2]: '1.0.0'

파이썬 3.6.2의 경우 :

import tensorflow as tf

print(tf.version.VERSION)

소스에서 Tensorflow 0.12rc를 설치했으며 다음 명령으로 버전 정보를 제공합니다.

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

다음 그림은 출력을 보여줍니다.

enter image description here


tensorflow 및 해당 옵션에 대한 자세한 정보를 얻으려면 아래 명령을 사용하십시오.

>> import tensorflow as tf
>> help(tf)

KERAS 및 TENSORFLOW 버전 번호를 쉽게 얻을 수 있습니다-> 터미널에서 다음 명령을 실행하십시오.

[username@usrnm:~] python3

>>import keras; print(keras.__version__)

Using TensorFlow backend.

2.2.4

>>import tensorflow as tf; print(tf.__version__)

1.12.0


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

Here -c represents program passed in as string (terminates option list)


On Latest TensorFlow release 1.14.0

tf.VERSION

is deprecated, instead of this use

tf.version.VERSION

ERROR:

WARNING: Logging before flag parsing goes to stderr.
The name tf.VERSION is deprecated. Please use tf.version.VERSION instead.

The tensorflow version can be checked either on terminal or console or in any IDE editer as well (like Spyder or Jupyter notebook, etc)

Simple command to check version:

(py36) C:\WINDOWS\system32>python
Python 3.6.8 |Anaconda custom (64-bit)

>>> import tensorflow as tf
>>> tf.__version__
'1.13.1'

For Python 3.6.3:

import tensorflow as tf

print(tf.VERSION)

참고URL : https://stackoverflow.com/questions/38549253/how-to-find-which-version-of-tensorflow-is-installed-in-my-system

반응형