title: ImportError: cannot import name 'LayerNormalization' from 'tensorflow.python.keras.layers.normalization' mismatch versions fix?
body: <p>Have not posted much on stackoverflow and new to tensorflow. I followed this tutorial on how to install tensorflow for use on jupyter notebooks (<a href="https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-mac-jan-2021.ipynb" rel="nofollow noreferrer">https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-mac-jan-2021.ipynb</a>).</p>
  <p>When testing the environment I get Python 3.8.11, Tensor Flow 2.5.1 and Keras 2.5.0</p>
  <p>Code I am trying to run:</p>
  <pre><code>import pandas as pd
  import numpy as np
  import tensorflow as tf
  import re
  from nltk.corpus import stopwords
  from sklearn.model_selection import train_test_split
  from sklearn.metrics import median_absolute_error as mae
  from sklearn.metrics import mean_squared_error as mse
  from sklearn.metrics import accuracy_score as acc
  import matplotlib.pyplot as plt
  
  from keras.models import Sequential
  from keras import initializers
  from keras.layers import Dropout, Activation, Embedding, Convolution1D, MaxPooling1D, Input, Dense, Merge, \
                           BatchNormalization, Flatten, Reshape, Concatenate
  from keras.layers.recurrent import LSTM, GRU
  from keras.callbacks import Callback, ModelCheckpoint, EarlyStopping, ReduceLROnPlateau
  from keras.models import Model
  from keras.optimizers import Adam, SGD, RMSprop
  from keras import regularizers
  </code></pre>
  <p>The error I get is</p>
  <pre><code>ImportError                               Traceback (most recent call last)
  &lt;ipython-input-4-3a64b96c6d78&gt; in &lt;module&gt;
       10 import matplotlib.pyplot as plt
       11 
  ---&gt; 12 from keras.models import Sequential
       13 from keras import initializers
       14 from keras.layers import Dropout, Activation, Embedding, Convolution1D, MaxPooling1D, Input, Dense, Merge, \
  
  /opt/miniconda3/envs/tensorflow/lib/python3.8/site-packages/keras/__init__.py in &lt;module&gt;
       23 
       24 # See b/110718070#comment18 for more details about this import.
  ---&gt; 25 from keras import models
       26 
       27 from keras.engine.input_layer import Input
  
  /opt/miniconda3/envs/tensorflow/lib/python3.8/site-packages/keras/models.py in &lt;module&gt;
       18 import tensorflow.compat.v2 as tf
       19 from keras import backend
  ---&gt; 20 from keras import metrics as metrics_module
       21 from keras import optimizer_v1
       22 from keras.engine import functional
  
  /opt/miniconda3/envs/tensorflow/lib/python3.8/site-packages/keras/metrics.py in &lt;module&gt;
       25 
       26 import numpy as np
  ---&gt; 27 from keras import activations
       28 from keras import backend
       29 from keras.engine import base_layer
  
  /opt/miniconda3/envs/tensorflow/lib/python3.8/site-packages/keras/activations.py in &lt;module&gt;
       18 
       19 from keras import backend
  ---&gt; 20 from keras.layers import advanced_activations
       21 from keras.utils.generic_utils import deserialize_keras_object
       22 from keras.utils.generic_utils import serialize_keras_object
  
  /opt/miniconda3/envs/tensorflow/lib/python3.8/site-packages/keras/layers/__init__.py in &lt;module&gt;
      146 
      147 # Normalization layers.
  --&gt; 148 from keras.layers.normalization import LayerNormalization
      149 from keras.layers.normalization_v2 import SyncBatchNormalization
      150 
  
  ImportError: cannot import name 'LayerNormalization' from 'keras.layers.normalization' (/opt/miniconda3/envs/tensorflow/lib/python3.8/site-packages/keras/layers/normalization/__init__.py)
  </code></pre>
  <p>I am aware that there have been posts about mismatch versions being the reason for this not working but not sure how I would go about independently changing the versions for tensorflow etc.. to make this work.</p>