Python Forum

Full Version: It says there is no keras in jupyter notebook. it is wrong there is a keras install
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I run the following code, I get the error shown below.

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
Output:
ImportError Traceback (most recent call last) <ipython-input-6-7abbf1c8e6c0> in <module> 1 import tensorflow as tf ----> 2 from tensorflow import keras 3 from tensorflow.keras import layers ImportError: cannot import name 'keras'
But keras is there as shown here:

Output:
jupyter_core 4.7.1 py38haa95532_0 jupyterlab-widgets 1.0.0 pypi_0 pypi jupyterlab_pygments 0.1.2 py_0 keras 2.4.3 pypi_0 pypi keras-preprocessing 1.1.2 pypi_0 pypi keras-tuner 1.0.2 pypi_0 pypi kiwisolver 1.3.1 pypi_0 pypi langdetect 1.0.8 pypi_0 pypi
I am using Windows 10 home version with 64bit. The tensorflow version is 2.4.1. It still does not like this line number two.

Output:
from tensorflow import keras
How do I get rid of this error?

Any help appreciated. Thanks in advance.

Respectfully,

LZ