title: How to noramilze a BatchDataset and use it in a model?
body: <p>I have a problem with normalizing a BatchDataset. I tried a lot of different ways but I always get some Errors e.g. ..not callable when I want to see if it worked out.</p>
  <pre><code>train_ds = tf.keras.preprocessing.image_dataset_from_directory(training_folder,
                                                                 image_size=(256, 256),
                                                                label_mode=&quot;binary&quot;)                                                      
  valid_ds = tf.keras.preprocessing.image_dataset_from_directory(validation_folder,
                                                                 image_size=(256, 256),
                                                                label_mode=&quot;binary&quot;)   
  </code></pre>
  <p>So I get this dataset shape.</p>
  <pre><code>&lt;BatchDataset shapes: ((None, 256, 256, 3), (None, 1)), types: (tf.float32, tf.float32)&gt;
  
  </code></pre>
  <p>How can I normalize this dataset?</p>
  <p>Futhermore my model.fit does not work but I can not find the problem.</p>
  <pre><code>num_classes = 2
  input_shape = (224, 224, 3)
  
  model = keras.Sequential(
      [
          keras.Input(shape=input_shape),
          layers.Conv2D(32, kernel_size=(3, 3), activation=&quot;relu&quot;),
          layers.MaxPooling2D(pool_size=(2, 2)),
          layers.Conv2D(64, kernel_size=(3, 3), activation=&quot;relu&quot;),
          layers.MaxPooling2D(pool_size=(2, 2)),
          layers.Conv2D(64, kernel_size=(3, 3), activation=&quot;relu&quot;),
          layers.MaxPooling2D(pool_size=(2, 2)),
          layers.Flatten(),
          layers.Dropout(0.5),
          layers.Dense(num_classes, activation=&quot;softmax&quot;),
      ]
  )
  
  model.compile(loss='binary_crossentropy',
                optimizer='rmsprop',
                metrics=['accuracy'])
  
  history = model.fit(train_ds, 
            epochs=5,
            batch_size=128,
            validation_data = valid_ds)
  </code></pre>
  <p>Any suggestions?
  Thanks!!</p>