Skip to content

Commit bea089a

Browse files
Merge pull request #2121 from synandi:patch-9
PiperOrigin-RevId: 472380587
2 parents fd3591b + edc3f91 commit bea089a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

site/en/guide/migrate/model_mapping.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@
10481048
"source": [
10491049
"random_tool = v1.keras.utils.DeterministicRandomTestTool(mode='num_random_ops')\n",
10501050
"with random_tool.scope():\n",
1051-
" tf.keras.utils.set_random_seed(42)\n",
1051+
" tf.keras.utils.set_random_seed(42)\n",
10521052
" layer = CompatModel(10)\n",
10531053
"\n",
10541054
" inputs = tf.random.normal(shape=(10, 5, 5, 5))\n",
@@ -1070,7 +1070,7 @@
10701070
"source": [
10711071
"random_tool = v1.keras.utils.DeterministicRandomTestTool(mode='num_random_ops')\n",
10721072
"with random_tool.scope():\n",
1073-
" tf.keras.utils.set_random_seed(42)\n",
1073+
" tf.keras.utils.set_random_seed(42)\n",
10741074
" layer = PartiallyMigratedModel(10)\n",
10751075
"\n",
10761076
" inputs = tf.random.normal(shape=(10, 5, 5, 5))\n",
@@ -1144,7 +1144,7 @@
11441144
"source": [
11451145
"random_tool = v1.keras.utils.DeterministicRandomTestTool(mode='num_random_ops')\n",
11461146
"with random_tool.scope():\n",
1147-
" tf.keras.utils.set_random_seed(42)\n",
1147+
" tf.keras.utils.set_random_seed(42)\n",
11481148
" layer = NearlyFullyNativeModel(10)\n",
11491149
"\n",
11501150
" inputs = tf.random.normal(shape=(10, 5, 5, 5))\n",
@@ -1218,7 +1218,7 @@
12181218
"source": [
12191219
"random_tool = v1.keras.utils.DeterministicRandomTestTool(mode='num_random_ops')\n",
12201220
"with random_tool.scope():\n",
1221-
" tf.keras.utils.set_random_seed(42)\n",
1221+
" tf.keras.utils.set_random_seed(42)\n",
12221222
" layer = FullyNativeModel(10)\n",
12231223
"\n",
12241224
" inputs = tf.random.normal(shape=(10, 5, 5, 5))\n",
@@ -1253,7 +1253,7 @@
12531253
"\n",
12541254
"The above migration process to native TF2 APIs changed both the variable names (as Keras APIs produce very different weight names), and the object-oriented paths that point to different weights in the model. The impact of these changes is that they will have broken both any existing TF1-style name-based checkpoints or TF2-style object-oriented checkpoints.\n",
12551255
"\n",
1256-
"However, in some cases, you might be able to take your original name-based checkpoint and find a mapping of the variables to their new names with approaches like the one detailed in the [Reusing TF1.x checkpoints guide](./reusing_checkpoints.ipynb).\n",
1256+
"However, in some cases, you might be able to take your original name-based checkpoint and find a mapping of the variables to their new names with approaches like the one detailed in the [Reusing TF1.x checkpoints guide](./migrating_checkpoints.ipynb).\n",
12571257
"\n",
12581258
"Some tips to making this feasible are as follows:\n",
12591259
"- Variables still all have a `name` argument you can set.\n",

0 commit comments

Comments
 (0)