Install keras in anaconda environment:

Install keras in anaconda environment:
When installing directly with pip, the installed keras will have a version incompatibility problem with tensorflow. The error prompt is as follows:

AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'

After referring to the version compatibility information website (the environment provided by the cloud server of the website is listed, so the combination of tensorflow and keras in the table can be used for reference, mainly see the two columns of Framework and Description):

https://docs.floydhub.com/guides/environments/

Check the keras version corresponding to your tensorflow from the table.
(How to check the version of tensorflow: Type conda list in anaconda prompt to check the version of tensorflow)

For example, I found that my tensorflow version is 1.12.0. After querying on the website, the corresponding keras compatible version is 2.2.4.
Then enter pip install keras == 2.2.4 in the anaconda prompt.

Reference URL: https://blog.csdn.net/qq_42823242/article/details/101717247

Published 31 original articles · Likes0 · Visits 682

Guess you like

Origin blog.csdn.net/ballzy/article/details/105313408