How to check which version of Keras is installed?

后端 未结 4 1574
暗喜
暗喜 2021-02-01 00:12

Question is the same as the title says.

I prefer not to open Python and I use either MacOS or Ubuntu.

相关标签:
4条回答
  • 2021-02-01 00:52

    You can write:

    python
    import keras
    keras.__version__
    
    0 讨论(0)
  • 2021-02-01 00:55

    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__)"
    
    0 讨论(0)
  • 2021-02-01 00:55

    Simple command to check keras version:

    (py36) C:\WINDOWS\system32>python
    Python 3.6.8 |Anaconda custom (64-bit) 
    
    >>> import keras
    Using TensorFlow backend.
    >>> keras.__version__
    '2.2.4'
    
    0 讨论(0)
  • 2021-02-01 00:58

    The simplest way is using pip command:

    pip list | grep Keras
    
    0 讨论(0)
提交回复
热议问题