thoughtworksarts / EmoPy

A deep neural net toolkit for emotion analysis via Facial Expression Recognition (FER)
https://thoughtworksarts.io/blog/emopy-emotional-expression-toolkit/
GNU Affero General Public License v3.0
919 stars 264 forks source link

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

Closed Francis621 closed 4 years ago

Francis621 commented 4 years ago

When I run "python fermodel_example.py" , the system said:AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph' What is the solutions?

cptanalatriste commented 4 years ago

Hello!

I run into a similar problem earlier, due to an unsupported version of Keras. Please run the following in your environment:

pip show keras

If the version is >= 2.3, you're probably facing the same issue. I fixed it by forcing an install of version 2.2 of the package, by running this command in my environment:

pip install 'keras==2.2.0'

Please let me know if the issue persists.

satishdash commented 4 years ago

Hey @cptanalatriste keras==2.2.4 is a solution that we are now going with. And yes an exact version of Keras 2.2.X but less than 2.3.0 solves the issue. Thanks. I believe this issue can be closed now! @xuv any opinions?

cptanalatriste commented 4 years ago

Duplicate of #44

cptanalatriste commented 4 years ago

@satishdash I just played safe and tried the minimal version supported in requirements.txt . If 2.2.4 also does the trick, go for it :D