Last answered:

28 Dec 2023

Posted on:

08 Dec 2021

0

ImportError: cannot import name 'LayerNormalization'

I followed all the steps and everything seems to install properly.
However, when I try to import Tensorflow as tf in Jupyter, I get the following
message "ImportError: cannot import name 'LayerNormalization' from
'tensorflow.python.keras.layers.normalization'" I tried to find the solution
online, but didn't manage. I think it might be because you have different
versions in your course. Then I tried to switch to Python 3.7 instead of 3.8
but again nothing. Please help me as I really want to continue learning

2 answers ( 0 marked as helpful)
Instructor
Posted on:

09 Dec 2021

0

Hi,

I am not exactly sure why you get this error but my suggestion right now is to uninstall and install the TensorFlow package again.
That seems to work for most people.

Let me know if it was fixed or not.

Best,
Nikola, 365 Team

Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Posted on:

28 Dec 2023

0

I was facing an import-error as well while importing tensorflow. Though the error was different for me (SymbolAlreadyExposedError). I don't know if this would help, but my problem got solved after using the "pip install --upgrade keras" command in the anaconda prompt.

Submit an answer