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

前端 未结 16 1910
轮回少年
轮回少年 2020-11-30 17:00

I need to find which version of TensorFlow I have installed. I\'m using Ubuntu 16.04 Long Term Support.

相关标签:
16条回答
  • 2020-11-30 17:29

    If you're using anaconda distribution of Python,

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

    To check it using Jupyter Notebook (IPython Notebook)

    In [1]: import tensorflow as tf
    In [2]: tf.__version__
    Out[2]: '1.0.0'
    
    0 讨论(0)
  • 2020-11-30 17:33

    For python 3.6.2:

    import tensorflow as tf
    
    print(tf.version.VERSION)
    
    0 讨论(0)
  • 2020-11-30 17:35
    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)

    0 讨论(0)
  • 2020-11-30 17:37

    If you have installed via pip, just run the following

    $ pip show tensorflow
    Name: tensorflow
    Version: 1.5.0
    Summary: TensorFlow helps the tensors flow
    
    0 讨论(0)
  • 2020-11-30 17:41

    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:

    0 讨论(0)
  • 2020-11-30 17:43

    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'
    
    0 讨论(0)
提交回复
热议问题