|
68 | 68 | "\n",
|
69 | 69 | "This tutorial demonstrates how to:\n",
|
70 | 70 | "\n",
|
71 |
| - "1. Use models from TensorFlow Hub with `keras`.\n", |
| 71 | + "1. Use models from TensorFlow Hub with `tf.keras`.\n", |
72 | 72 | "1. Use an image classification model from TensorFlow Hub.\n",
|
73 | 73 | "1. Do simple transfer learning to fine-tune a model for your own image classes."
|
74 | 74 | ]
|
|
340 | 340 | "id": "jFHdp18ccah7"
|
341 | 341 | },
|
342 | 342 | "source": [
|
343 |
| - "First, load this data into the model using the image data off disk with `keras.utils.image_dataset_from_directory`, which will generate a `tf.data.Dataset`:" |
| 343 | + "First, load this data into the model using the image data off disk with `tf.keras.utils.image_dataset_from_directory`, which will generate a `tf.data.Dataset`:" |
344 | 344 | ]
|
345 | 345 | },
|
346 | 346 | {
|
|
401 | 401 | "id": "L0Btd0V3C8h4"
|
402 | 402 | },
|
403 | 403 | "source": [
|
404 |
| - "Second, because TensorFlow Hub's convention for image models is to expect float inputs in the `[0, 1]` range, use the `keras.layers.Rescaling` preprocessing layer to achieve this." |
| 404 | + "Second, because TensorFlow Hub's convention for image models is to expect float inputs in the `[0, 1]` range, use the `tf.keras.layers.Rescaling` preprocessing layer to achieve this." |
405 | 405 | ]
|
406 | 406 | },
|
407 | 407 | {
|
|
410 | 410 | "id": "Rs6gfO-ApTQW"
|
411 | 411 | },
|
412 | 412 | "source": [
|
413 |
| - "Note: You could also include the `keras.layers.Rescaling` layer inside the model. Refer to the [Working with preprocessing layers](https://www.tensorflow.org/guide/keras/preprocessing_layers) guide for a discussion of the tradeoffs." |
| 413 | + "Note: You could also include the `tf.keras.layers.Rescaling` layer inside the model. Refer to the [Working with preprocessing layers](https://www.tensorflow.org/guide/keras/preprocessing_layers) guide for a discussion of the tradeoffs." |
414 | 414 | ]
|
415 | 415 | },
|
416 | 416 | {
|
|
622 | 622 | "source": [
|
623 | 623 | "### Attach a classification head\n",
|
624 | 624 | "\n",
|
625 |
| - "To complete the model, wrap the feature extractor layer in a `keras.Sequential` model and add a fully-connected layer for classification:" |
| 625 | + "To complete the model, wrap the feature extractor layer in a `tf.keras.Sequential` model and add a fully-connected layer for classification:" |
626 | 626 | ]
|
627 | 627 | },
|
628 | 628 | {
|
|
673 | 673 | "source": [
|
674 | 674 | "### Train the model\n",
|
675 | 675 | "\n",
|
676 |
| - "Use `Model.compile` to configure the training process and add a `keras.callbacks.TensorBoard` callback to create and store logs:" |
| 676 | + "Use `Model.compile` to configure the training process and add a `tf.keras.callbacks.TensorBoard` callback to create and store logs:" |
677 | 677 | ]
|
678 | 678 | },
|
679 | 679 | {
|
|
0 commit comments