title: How to use mobilenet_v2.preprocess_input on tensorflow dataset
body: <p>I'm again struggling with the usage of tensorflow datasets. I'm again loading my images via</p>
  <pre><code>data = keras.preprocessing.image_dataset_from_directory(
    './data', 
    labels='inferred', 
    label_mode='binary', 
    validation_split=0.2, 
    subset=&quot;training&quot;, 
    image_size=(img_height, img_width), 
    batch_size=sz_batch, 
    crop_to_aspect_ratio=True
  )
  </code></pre>
  <p>I want to use this dataset in the pre-trained MobileNetV2</p>
  <pre><code>model = keras.applications.mobilenet_v2.MobileNetV2(input_shape=(img_height, img_width, 3), weights='imagenet')
  </code></pre>
  <p>The <a href="https://www.tensorflow.org/api_docs/python/tf/keras/applications/mobilenet_v2/MobileNetV2" rel="nofollow noreferrer">documentation</a> says, that the input data must be scaled to be between -1 and 1. To do so, the <code>preprocess_input</code> function is provided. When I use this function on my dataset</p>
  <pre><code>scaled_data = tf.keras.applications.mobilenet_v2.preprocess_input(data)
  </code></pre>
  <p>I get the error: <code>TypeError: unsupported operand type(s) for /=: 'BatchDataset' and 'float'</code></p>
  <p>So how can I use this function properly with the tensorflow dataset?</p>