Skip to content

Commit 11c42a8

Browse files
Change Keras preprocessing APIs to stable in the Parameter server strategy tutorial
PiperOrigin-RevId: 405774290
1 parent b7ac1a2 commit 11c42a8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

site/en/tutorials/distribute/parameter_server_training.ipynb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@
187187
"import os\n",
188188
"import random\n",
189189
"import portpicker\n",
190-
"import tensorflow as tf\n",
191-
"from tensorflow.keras.layers.experimental import preprocessing"
190+
"import tensorflow as tf"
192191
]
193192
},
194193
{
@@ -527,7 +526,7 @@
527526
"\n",
528527
"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",
529528
"\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."
531530
]
532531
},
533532
{
@@ -544,10 +543,10 @@
544543
"label_vocab = [\"yes\", \"no\"]\n",
545544
"\n",
546545
"with strategy.scope():\n",
547-
" feature_lookup_layer = preprocessing.StringLookup(\n",
546+
" feature_lookup_layer = tf.keras.layers.StringLookup(\n",
548547
" vocabulary=feature_vocab,\n",
549548
" mask_token=None)\n",
550-
" label_lookup_layer = preprocessing.StringLookup(\n",
549+
" label_lookup_layer = tf.keras.layers.StringLookup(\n",
551550
" vocabulary=label_vocab,\n",
552551
" num_oov_indices=0,\n",
553552
" mask_token=None)\n",
@@ -1264,7 +1263,7 @@
12641263
"- 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",
12651264
"- It is not supported to load a checkpoint containing sharded optimizer slot variables into a different number of shards.\n",
12661265
"- 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",
12681267
"\n",
12691268
"### `Model.fit` specifics\n",
12701269
"\n",

0 commit comments

Comments
 (0)