|
137 | 137 | "id": "wO0InzL66URu"
|
138 | 138 | },
|
139 | 139 | "source": [
|
140 |
| - "## Download the flowers dataset\n", |
| 140 | + "### Download the flowers dataset\n", |
141 | 141 | "\n",
|
142 | 142 | "This tutorial uses a dataset of several thousand photos of flowers. The flowers dataset contains 5 sub-directories, one per class:\n",
|
143 | 143 | "\n",
|
|
248 | 248 | "id": "9_kge08gSCan"
|
249 | 249 | },
|
250 | 250 | "source": [
|
251 |
| - "# Load using keras.preprocessing\n", |
| 251 | + "## Load using keras.preprocessing\n", |
252 | 252 | "\n",
|
253 | 253 | "Let's load these images off disk using [image_dataset_from_directory](https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image_dataset_from_directory)."
|
254 | 254 | ]
|
|
270 | 270 | "id": "6jobDTUs8Wxu"
|
271 | 271 | },
|
272 | 272 | "source": [
|
273 |
| - "## Create a dataset" |
| 273 | + "### Create a dataset" |
274 | 274 | ]
|
275 | 275 | },
|
276 | 276 | {
|
|
377 | 377 | "id": "bK6CQCqIctCd"
|
378 | 378 | },
|
379 | 379 | "source": [
|
380 |
| - "## Visualize the data\n", |
| 380 | + "### Visualize the data\n", |
381 | 381 | "\n",
|
382 | 382 | "Here are the first 9 images from the training dataset."
|
383 | 383 | ]
|
|
456 | 456 | "id": "Ybl6a2YCg1rV"
|
457 | 457 | },
|
458 | 458 | "source": [
|
459 |
| - "## Standardize the data\n" |
| 459 | + "### Standardize the data\n" |
460 | 460 | ]
|
461 | 461 | },
|
462 | 462 | {
|
|
548 | 548 | "id": "Ti8avTlLofoJ"
|
549 | 549 | },
|
550 | 550 | "source": [
|
551 |
| - "## Configure the dataset for performance\n", |
| 551 | + "### Configure the dataset for performance\n", |
552 | 552 | "\n",
|
553 | 553 | "Let's make sure to use buffered prefetching so we can yield data from disk without having I/O become blocking. These are two important methods you should use when loading data.\n",
|
554 | 554 | "\n",
|
|
582 | 582 | "id": "XqHjIr6cplwY"
|
583 | 583 | },
|
584 | 584 | "source": [
|
585 |
| - "## Train a model\n", |
| 585 | + "### Train a model\n", |
586 | 586 | "\n",
|
587 | 587 | "For completeness, we will show how to train a simple model using the datasets we just prepared. This model has not been tuned in any way - the goal is to show you the mechanics using the datasets you just created. To learn more about image classification, visit this [tutorial](https://www.tensorflow.org/tutorials/images/classification)."
|
588 | 588 | ]
|
|
683 | 683 | "id": "AxS1cLzM8mEp"
|
684 | 684 | },
|
685 | 685 | "source": [
|
686 |
| - "# Using tf.data for finer control" |
| 686 | + "## Using tf.data for finer control" |
687 | 687 | ]
|
688 | 688 | },
|
689 | 689 | {
|
|
908 | 908 | "id": "vYGCgJuR_9Qp"
|
909 | 909 | },
|
910 | 910 | "source": [
|
911 |
| - "## Configure dataset for performance" |
| 911 | + "### Configure dataset for performance" |
912 | 912 | ]
|
913 | 913 | },
|
914 | 914 | {
|
|
955 | 955 | "id": "45P7OvzRWzOB"
|
956 | 956 | },
|
957 | 957 | "source": [
|
958 |
| - "## Visualize the data\n", |
| 958 | + "### Visualize the data\n", |
959 | 959 | "\n",
|
960 | 960 | "You can visualize this dataset similarly to the one you created previously."
|
961 | 961 | ]
|
|
988 | 988 | "id": "fMT8kh_uXPRU"
|
989 | 989 | },
|
990 | 990 | "source": [
|
991 |
| - "## Continue training the model\n", |
| 991 | + "### Continue training the model\n", |
992 | 992 | "\n",
|
993 | 993 | "You have now manually built a similar `tf.data.Dataset` to the one created by the `keras.preprocessing` above. You can continue training the model with it. As before, we will train for just a few epochs to keep the running time short."
|
994 | 994 | ]
|
|
1017 | 1017 | "id": "6cqkPenZIaHl"
|
1018 | 1018 | },
|
1019 | 1019 | "source": [
|
1020 |
| - "# Next steps\n", |
| 1020 | + "## Next steps\n", |
1021 | 1021 | "\n",
|
1022 | 1022 | "This tutorial showed two ways of loading images off disk. First, you learned how to load and preprocess an image dataset using Keras preprocessing layers and utilities. Next, you learned how to write an input pipeline from scratch using tf.data. As a next step, you can learn how to add data augmentation by visiting this [tutorial](https://www.tensorflow.org/tutorials/images/data_augmentation). To learn more about tf.data, you can visit this [guide](https://www.tensorflow.org/guide/data)."
|
1023 | 1023 | ]
|
|
0 commit comments