Skip to content

Instantly share code, notes, and snippets.

@fabclmnt
Created May 6, 2020 14:22
Show Gist options
  • Save fabclmnt/e1e89831548f07961a6e782994b58af0 to your computer and use it in GitHub Desktop.
Save fabclmnt/e1e89831548f07961a6e782994b58af0 to your computer and use it in GitHub Desktop.
def scale(image, label):
image = tf.cast(image, tf.float32)
image /= 255
return image, label
train_dataset = beans_train.map(scale).cache().shuffle(BUFFER_SIZE).batch(BATCH_SIZE)
eval_dataset = beans_test.map(scale).batch(BATCH_SIZE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment