Skip to content

Commit 720e555

Browse files
MarkDaoustcopybara-github
authored andcommitted
Switch tensorflow models docs to use tf-models-official.
This works now that 2.9 (tensorflow and tf-models) is released. PiperOrigin-RevId: 449782178
1 parent eecf755 commit 720e555

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

site/en/tutorials/images/classification_with_model_garden.ipynb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cells": [
2+
"cells": [
33
{
44
"cell_type": "markdown",
55
"metadata": {
@@ -88,7 +88,9 @@
8888
"source": [
8989
"## Setup\n",
9090
"\n",
91-
"Install and import the necessary modules. This tutorial uses the `tf-models-nightly` version of Model Garden."
91+
"Install and import the necessary modules. This tutorial uses the `tf-models-nightly` version of Model Garden.\n",
92+
"\n",
93+
"Note: Upgrading TensorFlow to 2.9 in Colab breaks GPU support, so this colab is set to run on CPU until the Colab runtimes are updated."
9294
]
9395
},
9496
{
@@ -100,7 +102,7 @@
100102
"outputs": [],
101103
"source": [
102104
"!pip uninstall -y opencv-python\n",
103-
"!pip install -q tf-models-nightly"
105+
"!pip install -U -q \"tensorflow>=2.9.0\" \"tf-models-official\""
104106
]
105107
},
106108
{
@@ -149,8 +151,9 @@
149151
"source": [
150152
"import tensorflow_models as tfm\n",
151153
"\n",
152-
"# Not in the tfm public API for v2.9. Will be available as `vision.serving` in v2.10\n",
153-
"from official.vision.serving import export_saved_model_lib"
154+
"# These are not in the tfm public API for v2.9. They will be available in v2.10\n",
155+
"from official.vision.serving import export_saved_model_lib\n",
156+
"import official.core.train_lib"
154157
]
155158
},
156159
{
@@ -668,16 +671,14 @@
668671
" show_batch(data['image'], data['label'], predictions)\n",
669672
"\n",
670673
" if device=='CPU':\n",
671-
" plt.suptitle('The model was only trained for a few steps, it is not expected to do well.')"
674+
" plt.suptitle('The model was only trained for a few steps, it is not expected to do better than random.')"
672675
]
673676
}
674677
],
675678
"metadata": {
676-
"accelerator": "GPU",
677679
"colab": {
678680
"collapsed_sections": [],
679-
"name": "models_vision.ipynb",
680-
"provenance": [],
681+
"name": "classification_with_model_garden.ipynb",
681682
"toc_visible": true
682683
},
683684
"kernelspec": {

0 commit comments

Comments
 (0)