From 3f59011075edeeff8f6b605c9cc2ea9ddcf5f9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Sat, 16 Apr 2022 08:59:29 +1200 Subject: [PATCH] comment out split GPU code, and add cleanup code --- 19_training_and_deploying_at_scale.ipynb | 56 +++++++++++++++++++----- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/19_training_and_deploying_at_scale.ipynb b/19_training_and_deploying_at_scale.ipynb index 0d1ac89..fe7966a 100644 --- a/19_training_and_deploying_at_scale.ipynb +++ b/19_training_and_deploying_at_scale.ipynb @@ -1522,12 +1522,11 @@ "metadata": {}, "outputs": [], "source": [ - "if physical_gpus:\n", - " tf.config.set_logical_device_configuration(\n", - " physical_gpus[0],\n", - " [tf.config.LogicalDeviceConfiguration(memory_limit=2048),\n", - " tf.config.LogicalDeviceConfiguration(memory_limit=2048)]\n", - " )" + "#tf.config.set_logical_device_configuration(\n", + "# physical_gpus[0],\n", + "# [tf.config.LogicalDeviceConfiguration(memory_limit=2048),\n", + "# tf.config.LogicalDeviceConfiguration(memory_limit=2048)]\n", + "#)" ] }, { @@ -1539,8 +1538,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "[LogicalDevice(name='/device:GPU:0', device_type='GPU'),\n", - " LogicalDevice(name='/device:GPU:1', device_type='GPU')]\n" + "[LogicalDevice(name='/device:GPU:0', device_type='GPU')]\n" ] } ], @@ -2075,8 +2073,6 @@ } ], "source": [ - "import tensorflow as tf\n", - "\n", "resolver = tf.distribute.cluster_resolver.TFConfigClusterResolver()\n", "resolver.cluster_spec()" ] @@ -2422,6 +2418,26 @@ ")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's clean up:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "mnist_model2.delete()\n", + "custom_training_job.delete()\n", + "blobs = bucket.list_blobs(prefix=f\"gs://{bucket_name}/staging/\")\n", + "for blob in blobs:\n", + " blob.delete()" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -2612,6 +2628,26 @@ ")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's clean up:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "mnist_model3.delete()\n", + "hp_search_job.delete()\n", + "blobs = bucket.list_blobs(prefix=f\"gs://{bucket_name}/staging/\")\n", + "for blob in blobs:\n", + " blob.delete()" + ] + }, { "cell_type": "markdown", "metadata": {},