mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +01:00
comment out split GPU code, and add cleanup code
This commit is contained in:
@@ -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": {},
|
||||
|
||||
Reference in New Issue
Block a user