arunponnusamy / cvlib

A simple, high level, easy to use, open source Computer Vision library for Python.

Home Page:http://arunponnusamy.com/cvlib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

myrzx opened this issue · comments

commented

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

Hey @myrzx, do you have tensorflow installed ?

commented

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

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

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?

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.

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

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.

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

commented

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.

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

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 :)

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

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.

@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.

downgrading keras to 2.2.4 solved my same issue

commented

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

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