Skip to content

Commit b77cf5e

Browse files
docs: update bucket variable in geospatial-classification (GoogleCloudPlatform#7619)
* docs: update bucket variable in geospatial-classification * Use the region variable Co-authored-by: David Cavazos
1 parent 6c4c8de commit b77cf5e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

people-and-planet-ai/geospatial-classification/README.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@
856856
"training_task = ee.batch.Export.table.toCloudStorage(\n",
857857
" collection=ee.FeatureCollection(train_features),\n",
858858
" description=\"Training image export\",\n",
859-
" bucket=bucket,\n",
859+
" bucket=cloud_storage_bucket,\n",
860860
" fileNamePrefix=\"geospatial_training\",\n",
861861
" selectors=BANDS + [LABEL],\n",
862862
" fileFormat=\"TFRecord\",\n",
@@ -867,7 +867,7 @@
867867
"validation_task = ee.batch.Export.table.toCloudStorage(\n",
868868
" collection=ee.FeatureCollection(validation_features),\n",
869869
" description=\"Validation image export\",\n",
870-
" bucket=bucket,\n",
870+
" bucket=cloud_storage_bucket,\n",
871871
" fileNamePrefix=\"geospatial_validation\",\n",
872872
" selectors= BANDS + [LABEL],\n",
873873
" fileFormat='TFRecord')\n",
@@ -928,7 +928,7 @@
928928
"source": [
929929
"from google.cloud import aiplatform\n",
930930
"\n",
931-
"aiplatform.init(project=project, staging_bucket=bucket)\n",
931+
"aiplatform.init(project=project, staging_bucket=cloud_storage_bucket)\n",
932932
"\n",
933933
"job = aiplatform.CustomTrainingJob(\n",
934934
" display_name=\"geospatial_model_training\",\n",
@@ -955,7 +955,7 @@
955955
},
956956
"outputs": [],
957957
"source": [
958-
"model = job.run(accelerator_type='NVIDIA_TESLA_K80', accelerator_count=1, args=[f'--bucket={bucket}'])"
958+
"model = job.run(accelerator_type='NVIDIA_TESLA_K80', accelerator_count=1, args=[f'--bucket={cloud_storage_bucket}'])"
959959
]
960960
},
961961
{
@@ -1013,7 +1013,7 @@
10131013
" --source=serving_app \\\n",
10141014
" --command=\"gunicorn\" \\\n",
10151015
" --args=\"--threads=8,--timeout=0,main:app\" \\\n",
1016-
" --region=\"us-central1\" \\\n",
1016+
" --region=\"{region}\" \\\n",
10171017
" --memory=\"1G\" \\\n",
10181018
" --no-allow-unauthenticated \\"
10191019
]
@@ -1246,7 +1246,7 @@
12461246
"requests.post(\n",
12471247
" url=f'{service_url}/predict',\n",
12481248
" headers={'Authorization': f'Bearer {identity_token}'},\n",
1249-
" json={'data': prediction_data, 'bucket': bucket},\n",
1249+
" json={'data': prediction_data, 'bucket': cloud_storage_bucket},\n",
12501250
").json()['predictions']"
12511251
]
12521252
},
@@ -1284,7 +1284,7 @@
12841284
" result = requests.post(\n",
12851285
" url=f'{service_url}/predict',\n",
12861286
" headers={'Authorization': f'Bearer {identity_token}'},\n",
1287-
" json={'data': prediction_data, 'bucket': bucket},).json()\n",
1287+
" json={'data': prediction_data, 'bucket': cloud_storage_bucket},).json()\n",
12881288
" return result['predictions']['predictions'][0][0][0][0]"
12891289
]
12901290
},

0 commit comments

Comments
 (0)