I use
layers.Normalization()
in Keras, in keras.Sequential
When I try to run it, I get the following error:
module 'tensorflow.keras.layers' has no attribute 'Normalization'
I've seen the command layers.Normalization() being used in many codes, so I don't know what's wrong. Did something change?
One reason can be that you are using the tensorflow version older then the required to use that layer. There are two ways to get around this problem.
tf.keras.layers.experimental.preprocessing.Normalization
Regards
Check the version of TensorFlow you have:
import tensorflow as tf
print(tf.__version__)
tf.keras.layers.Normalization is an attribute in TensorFlow v2.6.0, so might not work on earlier versions: https://www.tensorflow.org/api_docs/python/tf/keras/layers/Normalization
If you have an earlier version, you can upgrade using
pip install --upgrade tensorflow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With