|
187 | 187 | "import os\n",
|
188 | 188 | "import random\n",
|
189 | 189 | "import portpicker\n",
|
190 |
| - "import tensorflow as tf\n", |
191 |
| - "from tensorflow.keras.layers.experimental import preprocessing" |
| 190 | + "import tensorflow as tf" |
192 | 191 | ]
|
193 | 192 | },
|
194 | 193 | {
|
|
527 | 526 | "\n",
|
528 | 527 | "You will create these layers outside the `dataset_fn` but apply the transformation inside the `dataset_fn`, since you will wrap the `dataset_fn` into a `tf.function`, which doesn't allow variables to be created inside it.\n",
|
529 | 528 | "\n",
|
530 |
| - "Note: There is a known performance implication when using lookup table resources, which layers, such as `tf.keras.layers.experimental.preprocessing.StringLookup`, employ. Refer to the [Known limitations](#known_limitations) section for more information." |
| 529 | + "Note: There is a known performance implication when using lookup table resources, which layers, such as `tf.keras.layers.StringLookup`, employ. Refer to the [Known limitations](#known_limitations) section for more information." |
531 | 530 | ]
|
532 | 531 | },
|
533 | 532 | {
|
|
544 | 543 | "label_vocab = [\"yes\", \"no\"]\n",
|
545 | 544 | "\n",
|
546 | 545 | "with strategy.scope():\n",
|
547 |
| - " feature_lookup_layer = preprocessing.StringLookup(\n", |
| 546 | + " feature_lookup_layer = tf.keras.layers.StringLookup(\n", |
548 | 547 | " vocabulary=feature_vocab,\n",
|
549 | 548 | " mask_token=None)\n",
|
550 |
| - " label_lookup_layer = preprocessing.StringLookup(\n", |
| 549 | + " label_lookup_layer = tf.keras.layers.StringLookup(\n", |
551 | 550 | " vocabulary=label_vocab,\n",
|
552 | 551 | " num_oov_indices=0,\n",
|
553 | 552 | " mask_token=None)\n",
|
|
1264 | 1263 | "- It is not supported to load a saved_model via `tf.saved_model.load` containing sharded variables. Note loading such a saved_model using TensorFlow Serving is expected to work.\n",
|
1265 | 1264 | "- It is not supported to load a checkpoint containing sharded optimizer slot variables into a different number of shards.\n",
|
1266 | 1265 | "- It is not supported to recover from parameter server failure without restarting the coordinator task.\n",
|
1267 |
| - "- Usage of `tf.lookup.StaticHashTable` (which is commonly employed by some `tf.keras.layers.experimental.preprocessing` layers, such as `IntegerLookup`, `StringLookup`, and `TextVectorization`) results in resources placed on the coordinator at this time with parameter server training. This has performance implications for lookup RPCs from workers to the coordinator. This is a current high priority to address.\n", |
| 1266 | + "- Usage of `tf.lookup.StaticHashTable` (which is commonly employed by some Keras preprocessing layers, such as `tf.keras.layers.IntegerLookup`, `tf.keras.layers.StringLookup`, and `tf.keras.layers.TextVectorization`) results in resources placed on the coordinator at this time with parameter server training. This has performance implications for lookup RPCs from workers to the coordinator. This is a current high priority to address.\n", |
1268 | 1267 | "\n",
|
1269 | 1268 | "### `Model.fit` specifics\n",
|
1270 | 1269 | "\n",
|
|
0 commit comments