arunponnusamy / cvlib

A simple, high level, easy to use, open source Computer Vision library for Python.
http://arunponnusamy.com/cvlib/
MIT License
647 stars 127 forks source link

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

Open myrzx opened 4 years ago

myrzx commented 4 years ago

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

arunponnusamy commented 4 years ago

Hey @myrzx, do you have tensorflow installed ?

myrzx commented 4 years ago

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 commented 4 years ago

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

arunponnusamy commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

kumaranu7 commented 4 years ago

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 commented 4 years ago

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

Kehlo commented 4 years ago

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 commented 4 years ago

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

pdrapi commented 4 years ago

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 commented 4 years ago

https://github.com/thoughtworksarts/EmoPy/issues/44#issuecomment-534246104

Shrawant13 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

downgrading keras to 2.2.4 solved my same issue

tommy3266 commented 3 years ago

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

Yumlembam commented 2 years ago

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

aWindTalker commented 2 years ago

     thanks for your help! Good luck!

------------------ 原始邮件 ------------------ 发件人: "arunponnusamy/cvlib" @.>; 发送时间: 2022年5月26日(星期四) 晚上8:50 @.>; @.***>; 主题: Re: [arunponnusamy/cvlib] module 'tensorflow.python.keras.backend' has no attribute 'get_graph' (#28)

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

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>