diff --git a/13_loading_and_preprocessing_data.ipynb b/13_loading_and_preprocessing_data.ipynb
index ed70265..12257f1 100644
--- a/13_loading_and_preprocessing_data.ipynb
+++ b/13_loading_and_preprocessing_data.ipynb
@@ -9,6 +9,17 @@
"_This notebook contains all the sample code and solutions to the exercises in chapter 13._"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "
"
+ ]
+ },
{
"cell_type": "markdown",
"metadata": {},
@@ -20,7 +31,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "First, let's import a few common modules, ensure MatplotLib plots figures inline and prepare a function to save the figures. We also check that Python 3.5 or later is installed (although Python 2.x may work, it is deprecated so we strongly recommend you use Python 3 instead), as well as Scikit-Learn ≥0.20 and TensorFlow ≥2.0-preview."
+ "First, let's import a few common modules, ensure MatplotLib plots figures inline and prepare a function to save the figures. We also check that Python 3.5 or later is installed (although Python 2.x may work, it is deprecated so we strongly recommend you use Python 3 instead), as well as Scikit-Learn ≥0.20 and TensorFlow ≥2.0."
]
},
{
@@ -37,7 +48,15 @@
"import sklearn\n",
"assert sklearn.__version__ >= \"0.20\"\n",
"\n",
- "# TensorFlow ≥2.0-preview is required\n",
+ "try:\n",
+ " # %tensorflow_version only exists in Colab.\n",
+ " %tensorflow_version 2.x\n",
+ " !pip install -q -U tfx==0.15.0rc0\n",
+ " print(\"You can safely ignore the package incompatibility errors.\")\n",
+ "except Exception:\n",
+ " pass\n",
+ "\n",
+ "# TensorFlow ≥2.0 is required\n",
"import tensorflow as tf\n",
"from tensorflow import keras\n",
"assert tf.__version__ >= \"2.0\"\n",
@@ -1379,8 +1398,7 @@
"HOUSING_URL = DOWNLOAD_ROOT + \"datasets/housing/housing.tgz\"\n",
"\n",
"def fetch_housing_data(housing_url=HOUSING_URL, housing_path=HOUSING_PATH):\n",
- " if not os.path.isdir(housing_path):\n",
- " os.makedirs(housing_path)\n",
+ " os.makedirs(housing_path, exist_ok=True)\n",
" tgz_path = os.path.join(housing_path, \"housing.tgz\")\n",
" urllib.request.urlretrieve(housing_url, tgz_path)\n",
" housing_tgz = tarfile.open(tgz_path)\n",
@@ -1747,18 +1765,6 @@
"model.fit(mnist_train, steps_per_epoch=60000 // 32, epochs=5)"
]
},
- {
- "cell_type": "code",
- "execution_count": 110,
- "metadata": {},
- "outputs": [],
- "source": [
- "try:\n",
- " datasets = tfds.load(\"imagenet2012\", split=[\"train\", \"test\"])\n",
- "except AssertionError as ex:\n",
- " print(ex)"
- ]
- },
{
"cell_type": "markdown",
"metadata": {},
@@ -1768,7 +1774,7 @@
},
{
"cell_type": "code",
- "execution_count": 111,
+ "execution_count": 110,
"metadata": {},
"outputs": [],
"source": [
@@ -1787,7 +1793,7 @@
},
{
"cell_type": "code",
- "execution_count": 112,
+ "execution_count": 111,
"metadata": {},
"outputs": [],
"source": [
@@ -1797,7 +1803,7 @@
},
{
"cell_type": "code",
- "execution_count": 113,
+ "execution_count": 112,
"metadata": {},
"outputs": [],
"source": [
@@ -1828,7 +1834,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.4"
+ "version": "3.7.3"
},
"nav_menu": {
"height": "264px",