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

Time:12-18

When I try:

normalization_layer = layers.Rescaling(1./255)

error message:

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

How to fix it?

CodePudding user response:

Yes, I used a wrong version of tf. Rescaling in tf v2.70, i used v2.60.

A preprocessing layer which rescales input values to a new range. Inherits From: Layer, Module

tf.keras.layers.Rescaling(
    scale, offset=0.0, **kwargs
)
  • Related