Issue
I am trying to run a code using keras. The program uses from keras.backend.tensorflow_backend import set_session
and i am getting the following error:
File "c:/Users/phili/Desktop/python-projects/test.py", line 15, in <module>
from keras.backend.tensorflow_backend import set_session
ModuleNotFoundError: No module named 'keras.backend.tensorflow_backend';
'keras.backend' is not a package
I am using python 3.7 Keras 2.4.3 and tensorflow 2.2.0
Is there any solution to the problem?
Solution
I guess you are importing it incorrectly.
The command to import set_session
, for Tensorflow 2.3
(latest version) is shown below:
from tensorflow.compat.v1.keras.backend import set_session
Please find this Colab for working code.
Please refer this Tensorflow Documentation for more information.
Answered By - user11530462
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.