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

前端 未结 16 1912
轮回少年
轮回少年 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:45

    Another variation, i guess :P

    python3 -c 'print(__import__("tensorflow").__version__)'

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

    Almost every normal package in python assigns the variable .__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__
    

    For tensorflow it will be

    import tensorflow as tf
    tf.version.VERSION
    

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

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

    If you have TensorFlow 2.x:

    sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(log_device_placement=True))

    0 讨论(0)
  • 2020-11-30 17:50
    import tensorflow as tf
    
    print(tf.VERSION)
    
    0 讨论(0)
  • 2020-11-30 17:50

    Tensorflow version in Jupyter Notebook:-

    !pip list | grep tensorflow
    
    0 讨论(0)
  • 2020-11-30 17:52

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