From 691bd68d6ca48fbb5effdb760ad9cd225649d0af Mon Sep 17 00:00:00 2001 From: Matt Watson Date: Tue, 19 Aug 2025 23:17:31 -0700 Subject: [PATCH 1/2] Switch chapter 2 backend to tf --- chapter02_mathematical-building-blocks.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter02_mathematical-building-blocks.ipynb b/chapter02_mathematical-building-blocks.ipynb index 4f6e64262..de53b0dd6 100644 --- a/chapter02_mathematical-building-blocks.ipynb +++ b/chapter02_mathematical-building-blocks.ipynb @@ -29,7 +29,7 @@ "outputs": [], "source": [ "import os\n", - "os.environ[\"KERAS_BACKEND\"] = \"jax\"" + "os.environ[\"KERAS_BACKEND\"] = \"tensorflow\"" ] }, { From 5bcc7b77ff1909e01c8c48c6f5ca31b15e796197 Mon Sep 17 00:00:00 2001 From: Matt Watson Date: Thu, 21 Aug 2025 13:33:47 -0700 Subject: [PATCH 2/2] Update notebooks --- chapter07_deep-dive-keras.ipynb | 2 +- chapter11_image-segmentation.ipynb | 13 +++++++++++++ chapter14_text-classification.ipynb | 16 ++++++++++++++++ chapter16_text-generation.ipynb | 8 ++++---- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/chapter07_deep-dive-keras.ipynb b/chapter07_deep-dive-keras.ipynb index 821108812..be5963473 100644 --- a/chapter07_deep-dive-keras.ipynb +++ b/chapter07_deep-dive-keras.ipynb @@ -6,7 +6,7 @@ "colab_type": "text" }, "source": [ - "This is a companion notebook for the book [Deep Learning with Python, Third Edition](https://www.manning.com/books/deep-learning-with-python-third-edition). For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, figures, and pseudocode.\n\n**If you want to be able to follow what's going on, I recommend reading the notebook side by side with your copy of the book.**\n\nThe book's contents are available online at [deeplearningwithpython.io](https://deeplearningwithpython.io).\n" + "This is a companion notebook for the book [Deep Learning with Python, Third Edition](https://www.manning.com/books/deep-learning-with-python-third-edition). For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, figures, and pseudocode.\n\n**If you want to be able to follow what's going on, I recommend reading the notebook side by side with your copy of the book.**\n\nThe book's contents are available online at [deeplearningwithpython.io](https://deeplearningwithpython.io)." ] }, { diff --git a/chapter11_image-segmentation.ipynb b/chapter11_image-segmentation.ipynb index 02956e9c7..74f4c6b13 100644 --- a/chapter11_image-segmentation.ipynb +++ b/chapter11_image-segmentation.ipynb @@ -259,6 +259,19 @@ "model = get_model(img_size=img_size, num_classes=3)" ] }, + { + "cell_type": "code", + "execution_count": 0, + "metadata": { + "colab_type": "code" + }, + "outputs": [], + "source": [ + "# \u26a0\ufe0fNOTE\u26a0\ufe0f: The following IoU metric is *very* slow on the PyTorch backend!\n", + "# If you are running with PyTorch, we recommend re-running the notebook with Jax\n", + "# or TensorFlow, or skipping to the next section of this chapter." + ] + }, { "cell_type": "code", "execution_count": 0, diff --git a/chapter14_text-classification.ipynb b/chapter14_text-classification.ipynb index 75c19d991..15e34f0f0 100644 --- a/chapter14_text-classification.ipynb +++ b/chapter14_text-classification.ipynb @@ -1106,6 +1106,22 @@ "model.summary(line_length=80)" ] }, + { + "cell_type": "code", + "execution_count": 0, + "metadata": { + "colab_type": "code" + }, + "outputs": [], + "source": [ + "# \u26a0\ufe0fNOTE\u26a0\ufe0f: The following fit call will error on a T4 GPU on the TensorFlow\n", + "# backend due to a bug in TensorFlow. If you the follow cell errors out,\n", + "# do one of the following:\n", + "# - Skip the following two cells.\n", + "# - Switch to the Jax or Torch backend and re-run this notebook.\n", + "# - Change the GPU type in your runtime (requires Colab Pro as of this writing)." + ] + }, { "cell_type": "code", "execution_count": 0, diff --git a/chapter16_text-generation.ipynb b/chapter16_text-generation.ipynb index d8431361f..06ce65647 100644 --- a/chapter16_text-generation.ipynb +++ b/chapter16_text-generation.ipynb @@ -6,7 +6,7 @@ "colab_type": "text" }, "source": [ - "This is a companion notebook for the book [Deep Learning with Python, Third Edition](https://www.manning.com/books/deep-learning-with-python-third-edition). For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, figures, and pseudocode.\n\n**If you want to be able to follow what's going on, I recommend reading the notebook side by side with your copy of the book.**\n\nThe book's contents are available online at [deeplearningwithpython.io](https://deeplearningwithpython.io)." + "This is a companion notebook for the book [Deep Learning with Python, Third Edition](https://www.manning.com/books/deep-learning-with-python-third-edition). For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, figures, and pseudocode.\n\n**If you want to be able to follow what's going on, I recommend reading the notebook side by side with your copy of the book.**\n\nThe book's contents are available online at [deeplearningwithpython.io](https://deeplearningwithpython.io).\n" ] }, { @@ -972,9 +972,9 @@ }, "outputs": [], "source": [ - "# NOTE: If you are running on the free tier Colab GPUs, you will need to restart\n", - "# your runtime and run the notebook from here to free up memory for this\n", - "# 4 billion parameter model.\n", + "# \u26a0\ufe0fNOTE\u26a0\ufe0f: If you are running on the free tier Colab GPUs, you will need to\n", + "# restart your runtime and run the notebook from here to free up memory for\n", + "# this 4 billion parameter model.\n", "import os\n", "\n", "os.environ[\"KERAS_BACKEND\"] = \"jax\"\n",