Search code examples
pythontensorflowkerastheano

How to check if Keras backend is tensorflow or theano


I want to check in code what backend keras is using. Whether it is tensorflow or theano? How can I get this?

The code here uses K._BACKEND, however I'm getting an error saying that attribute not found. My Keras version is 2.2.5


Solution

  • From here, the following works

    from keras import backend as K
    
    print(K.backend())