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 'keras.backend' has no attribute 'get_session' #172

Open
Sepideh-Rezaeirad opened this issue Oct 1, 2020 · 3 comments
Open

module 'keras.backend' has no attribute 'get_session' #172

Sepideh-Rezaeirad opened this issue Oct 1, 2020 · 3 comments

Comments

@Sepideh-Rezaeirad
Copy link

Hi there,
I face with the error, when I run colab _demo
could anyone help?

Thanks in advance,

@LanGuipeng
Copy link

you can change the version of tensorflow, i tried it and it worked!

@chiazor
Copy link

chiazor commented Nov 19, 2020

like @LanGuipeng mentioned, changing the version of tensorflow.
running import tensorflow on colab, will import the default version.
you can specify the version you want before you run the import tensorflow cell by adding
%tensorflow_version 1.x

@FSalfate
Copy link

FSalfate commented Apr 9, 2021

hello, i'm having the same issue in my computer.

I'm trying to run MTCNN_video_face_detection_alignment.ipynb in my computer (it works in google collab) to get faces meanwhile i'm training a net in google colab, but I keep getting the message "module 'keras.backend' has no attribute 'get_session'".

I'm ussing the specified versions (python 3.6.4, tensorflow 1.6.0 and keras 2.1.5) and even I've tried different versions of tensorflow 1.x, but nothing works.

Edit: ok it seems that changing

from keras import backend as K

to

import keras.backend.tensorflow_backend as K

works.

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

4 participants