Skip to content

Commit

Permalink
Update migrate.ipynb (#5315)
Browse files Browse the repository at this point in the history
Updated `2.0` to `2.x` for better understanding.
  • Loading branch information
jvishnuvardhan authored Sep 17, 2021
1 parent d59f50b commit 47a9c05
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/migrate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"id": "HEYuO5NFwDK9"
},
"source": [
"# Migrating tf.summary usage to TF 2.0\n",
"# Migrating tf.summary usage to TF 2.x\n",
"\n",
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
" <td>\n",
Expand All @@ -61,7 +61,7 @@
"id": "56V5oun18ZdZ"
},
"source": [
"> Note: This doc is for people who are already familiar with TensorFlow 1.x TensorBoard and who want to migrate large TensorFlow code bases from TensorFlow 1.x to 2.0. If you're new to TensorBoard, see the [get started](get_started.ipynb) doc instead. If you are using `tf.keras` there may be no action you need to take to upgrade to TensorFlow 2.0. \n"
"> Note: This doc is for people who are already familiar with TensorFlow 1.x TensorBoard and who want to migrate large TensorFlow code bases from TensorFlow 1.x to 2.x. If you're new to TensorBoard, see the [get started](get_started.ipynb) doc instead. If you are using `tf.keras` there may be no action you need to take to upgrade to TensorFlow 2.x. \n"
]
},
{
Expand All @@ -81,7 +81,7 @@
"id": "56XvRdPy-ewT"
},
"source": [
"TensorFlow 2.0 includes significant changes to the `tf.summary` API used to write summary data for visualization in TensorBoard."
"TensorFlow 2.x includes significant changes to the `tf.summary` API used to write summary data for visualization in TensorBoard."
]
},
{
Expand All @@ -106,7 +106,7 @@
"source": [
"### In TF 1.x\n",
"\n",
"The two halves had to be manually wired together - by fetching the summary op outputs via `Session.run()` and calling `FileWriter.add_summary(output, step)`. The `v1.summary.merge_all()` op made this easier by using a graph collection to aggregate all summary op outputs, but this approach still worked poorly for eager execution and control flow, making it especially ill-suited for TF 2.0."
"The two halves had to be manually wired together - by fetching the summary op outputs via `Session.run()` and calling `FileWriter.add_summary(output, step)`. The `v1.summary.merge_all()` op made this easier by using a graph collection to aggregate all summary op outputs, but this approach still worked poorly for eager execution and control flow, making it especially ill-suited for TF 2.x."
]
},
{
Expand All @@ -126,7 +126,7 @@
"id": "em7GQju5VA0I"
},
"source": [
"Example usage with eager execution, the default in TF 2.0:"
"Example usage with eager execution, the default in TF 2.x:"
]
},
{
Expand Down Expand Up @@ -254,7 +254,7 @@
"source": [
"## Converting your code\n",
"\n",
"Converting existing `tf.summary` usage to the TF 2.0 API cannot be reliably automated, so the [`tf_upgrade_v2` script](https://www.tensorflow.org/guide/upgrade) just rewrites it all to `tf.compat.v1.summary`. To migrate to TF 2.0, you'll need to adapt your code as follows:"
"Converting existing `tf.summary` usage to the TF 2.x API cannot be reliably automated, so the [`tf_upgrade_v2` script](https://www.tensorflow.org/guide/upgrade) just rewrites it all to `tf.compat.v1.summary`. To migrate to TF 2.x, you'll need to adapt your code as follows:"
]
},
{
Expand Down Expand Up @@ -285,10 +285,10 @@
"1. [Only for legacy graph mode / session execution users]\n",
" - First initialize the writer with `v1.Session.run(writer.init())`\n",
"\n",
" - Use `v1.summary.all_v2_summary_ops()` to get all TF 2.0 summary ops for the current graph, e.g. to execute them via `Session.run()`\n",
" - Use `v1.summary.all_v2_summary_ops()` to get all TF 2.x summary ops for the current graph, e.g. to execute them via `Session.run()`\n",
" - Flush the writer with `v1.Session.run(writer.flush())` and likewise for `close()`\n",
"\n",
"If your TF 1.x code was instead using `tf.contrib.summary` API, it's much more similar to the TF 2.0 API, so `tf_upgrade_v2` script will automate most of the migration steps (and emit warnings or errors for any usage that cannot be fully migrated). For the most part it just rewrites the API calls to `tf.compat.v2.summary`; if you only need compatibility with TF 2.0+ you can drop the `compat.v2` and just reference it as `tf.summary`."
"If your TF 1.x code was instead using `tf.contrib.summary` API, it's much more similar to the TF 2.x API, so `tf_upgrade_v2` script will automate most of the migration steps (and emit warnings or errors for any usage that cannot be fully migrated). For the most part it just rewrites the API calls to `tf.compat.v2.summary`; if you only need compatibility with TF 2.x you can drop the `compat.v2` and just reference it as `tf.summary`."
]
},
{
Expand Down Expand Up @@ -320,8 +320,8 @@
"source": [
"* No direct writing of `tf.compat.v1.Graph` - instead use trace functions\n",
"\n",
" - Graph execution in TF 2.0 uses `@tf.function` instead of the explicit Graph\n",
" - In TF 2.0, use the new tracing-style APIs `tf.summary.trace_on()` and `tf.summary.trace_export()` to record executed function graphs\n"
" - Graph execution in TF 2.x uses `@tf.function` instead of the explicit Graph\n",
" - In TF 2.x, use the new tracing-style APIs `tf.summary.trace_on()` and `tf.summary.trace_export()` to record executed function graphs\n"
]
},
{
Expand Down

0 comments on commit 47a9c05

Please sign in to comment.