comment out split GPU code, and add cleanup code

main
Aurélien Geron 2022-04-16 08:59:29 +12:00
parent ce5fa07d59
commit 3f59011075
1 changed files with 46 additions and 10 deletions

View File

@ -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": {},