From b03215db17e7631a2b2470e1af3d701d4eb2ce9b Mon Sep 17 00:00:00 2001 From: Fabien Hertschuh <1091026+hertschuh@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:06:04 -0700 Subject: [PATCH] Fix in documentation of "Image classification from scratch" example. Fixes https://github.com/keras-team/keras-io/issues/2199 --- examples/vision/image_classification_from_scratch.py | 3 +-- examples/vision/ipynb/image_classification_from_scratch.ipynb | 3 +-- examples/vision/md/image_classification_from_scratch.md | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/vision/image_classification_from_scratch.py b/examples/vision/image_classification_from_scratch.py index 12266b5459..5b02fec32c 100644 --- a/examples/vision/image_classification_from_scratch.py +++ b/examples/vision/image_classification_from_scratch.py @@ -187,8 +187,7 @@ def data_augmentation(images): augmented images, like this: ```python -augmented_train_ds = train_ds.map( - lambda x, y: (data_augmentation(x, training=True), y)) +augmented_train_ds = train_ds.map(lambda x, y: (data_augmentation(x), y)) ``` With this option, your data augmentation will happen **on CPU**, asynchronously, and will diff --git a/examples/vision/ipynb/image_classification_from_scratch.ipynb b/examples/vision/ipynb/image_classification_from_scratch.ipynb index 2da0170705..bc3134c63b 100644 --- a/examples/vision/ipynb/image_classification_from_scratch.ipynb +++ b/examples/vision/ipynb/image_classification_from_scratch.ipynb @@ -324,8 +324,7 @@ "augmented images, like this:\n", "\n", "```python\n", - "augmented_train_ds = train_ds.map(\n", - " lambda x, y: (data_augmentation(x, training=True), y))\n", + "augmented_train_ds = train_ds.map(lambda x, y: (data_augmentation(x), y))\n", "```\n", "\n", "With this option, your data augmentation will happen **on CPU**, asynchronously, and will\n", diff --git a/examples/vision/md/image_classification_from_scratch.md b/examples/vision/md/image_classification_from_scratch.md index c69fd2925f..394fc312bb 100644 --- a/examples/vision/md/image_classification_from_scratch.md +++ b/examples/vision/md/image_classification_from_scratch.md @@ -236,8 +236,7 @@ If you're training on GPU, this may be a good option. augmented images, like this: ```python -augmented_train_ds = train_ds.map( - lambda x, y: (data_augmentation(x, training=True), y)) +augmented_train_ds = train_ds.map(lambda x, y: (data_augmentation(x), y)) ``` With this option, your data augmentation will happen **on CPU**, asynchronously, and will