Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'tensorflow.python.keras.backend' has no attribute 'get_graph' #28

Open
myrzx opened this issue Oct 11, 2019 · 19 comments
Open

module 'tensorflow.python.keras.backend' has no attribute 'get_graph' #28

myrzx opened this issue Oct 11, 2019 · 19 comments

Comments

@myrzx
Copy link

myrzx commented Oct 11, 2019

import cvlib
then...
AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'
What should I do?

@arunponnusamy
Copy link
Owner

Hey @myrzx, do you have tensorflow installed ?

@myrzx
Copy link
Author

myrzx commented Oct 14, 2019

Hey @myrzx, do you have tensorflow installed ?

Yes, I did.By tensorflow. Python. Keras. In the backend get_graph to tf. Graph (), has now been solved this problem

@kumaranu7
Copy link

kumaranu7 commented Oct 21, 2019

Hey @myrzx i am facing the same issue.. @arunponnusamy can you help me out??

@arunponnusamy
Copy link
Owner

Hey @kumaranu7, can you share the detailed steps you followed which resulted in this issue ? also the system / platform details you are running the code on and version of the packages and python?

@kumaranu7
Copy link

On executing "conda install -c conda-forge keras" in command prompt the above error appeared.
Windows 10, Python 3.6
P.S. I am trying "conda install anaconda" in command prompt followed by "conda update --all", to solve the above problem.
If any modifications are needed do let me know.

@arunponnusamy
Copy link
Owner

Can you try installing cvlib and the dependencies with pip ?
I haven't tested the installation with conda.

@kumaranu7
Copy link

I am using google colab now. Thanks for your help if any problem persists on this platform i will retrieve to cvlib. Thanks for the repository.

@farhanc4kra
Copy link

just replacing
from keras import backend
with:
from tensorflow.keras import backend

@Kehlo
Copy link

Kehlo commented Jan 16, 2020

Depending on your tensorflow version you have to find a fitting keras 2.2.x version. I was working with tf 1.13.1 and had to downgrade from keras 2.3.1 to 2.2.4. That solved the problem.

@zulfiqarAlibalti
Copy link

I am also same issue please any one help .I am using pip miniconda tf and keras.

@pdrapi
Copy link

pdrapi commented Mar 3, 2020

After long hours of research what worked for me was downgrading the python version from 3.8.2 to 3.7.6, by creating the virtual environment. It worked for Mac OS.

command : virtualenv -p /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 venv
^path to the version of the python that you need ^name of venv
Hope that helps :)

@gmt710
Copy link

gmt710 commented Mar 10, 2020

@Shrawant13
Copy link

After long hours of research what worked for me was downgrading the python version from 3.8.2 to 3.7.6, by creating the virtual environment. It worked for Mac OS.

command : virtualenv -p /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 venv
^path to the version of the python that you need ^name of venv
Hope that helps :)

Can you please give me the steps to do it

@pdrapi
Copy link

pdrapi commented Mar 11, 2020

After long hours of research what worked for me was downgrading the python version from 3.8.2 to 3.7.6, by creating the virtual environment. It worked for Mac OS.
command : virtualenv -p /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 venv
^path to the version of the python that you need ^name of venv
Hope that helps :)

Can you please give me the steps to do it

Download python version 3.7.6 from this website: https://www.python.org/downloads/release/python-376/
Download virtual environment, for mac users in terminal type -> pip install virtualenv
I don't know what is it for windows, google it if needed.
Then create a virtual environment by using this command:
virtualenv -p /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 venv
where the path is the path to your python 3.7.6 (installed folder)

Activate the virtual environment : source venv/bin/activate
Now you are in the virtual environment that you created. Now pip install all of the packages you need for your project here.

@arunponnusamy
Copy link
Owner

@Shrawant13 can you try with the latest version of cvlib (0.2.4) ? I have switched from standalone keras to tf.keras . Hopefully this issue should go away.

@ghost
Copy link

ghost commented May 1, 2020

downgrading keras to 2.2.4 solved my same issue

@tommy3266
Copy link

try the tensorflow version==1.15.3 and keras version==2.2.4,it works,trust me!

@Yumlembam
Copy link

change
Import keras..
to
Import tensorflow.keras..

@aWindTalker
Copy link

aWindTalker commented May 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests