|
1 | 1 | {
|
2 |
| - "cells": [ |
| 2 | + "cells": [ |
3 | 3 | {
|
4 | 4 | "cell_type": "markdown",
|
5 | 5 | "metadata": {
|
|
88 | 88 | "source": [
|
89 | 89 | "## Setup\n",
|
90 | 90 | "\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." |
92 | 94 | ]
|
93 | 95 | },
|
94 | 96 | {
|
|
100 | 102 | "outputs": [],
|
101 | 103 | "source": [
|
102 | 104 | "!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\"" |
104 | 106 | ]
|
105 | 107 | },
|
106 | 108 | {
|
|
149 | 151 | "source": [
|
150 | 152 | "import tensorflow_models as tfm\n",
|
151 | 153 | "\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" |
154 | 157 | ]
|
155 | 158 | },
|
156 | 159 | {
|
|
668 | 671 | " show_batch(data['image'], data['label'], predictions)\n",
|
669 | 672 | "\n",
|
670 | 673 | " 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.')" |
672 | 675 | ]
|
673 | 676 | }
|
674 | 677 | ],
|
675 | 678 | "metadata": {
|
676 |
| - "accelerator": "GPU", |
677 | 679 | "colab": {
|
678 | 680 | "collapsed_sections": [],
|
679 |
| - "name": "models_vision.ipynb", |
680 |
| - "provenance": [], |
| 681 | + "name": "classification_with_model_garden.ipynb", |
681 | 682 | "toc_visible": true
|
682 | 683 | },
|
683 | 684 | "kernelspec": {
|
|
0 commit comments