Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'tensorflow.keras.layers' has no attribute 'Rescaling'

When I try:

normalization_layer = layers.Rescaling(1./255)

error message:

AttributeError: module 'tensorflow.keras.layers' has no attribute 'Rescaling'

How to fix it?

like image 978
Bob Zheng Avatar asked Jun 30 '26 22:06

Bob Zheng


1 Answers

I had the same error in v2.5.0

tf.keras.layers.experimental.preprocessing.Rescaling()

I guess this is the "old" way to use this layer

like image 86
Adi Shumely Avatar answered Jul 02 '26 19:07

Adi Shumely



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!