Files
Zhaoqi 4f6b1f6b52 Revert "New folder structure (#4694)" (#4701)
This reverts commit 970d88ee18 due to broken blog links
2024-07-09 12:54:45 -04:00

1157 lines
35 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "41ffbbab-70db-4b3a-954b-46eb853feebb",
"metadata": {},
"source": [
"# How to use SageMaker Processing with geospatial image\n",
"\n",
"---\n",
"\n",
"This notebook's CI test result for us-west-2 is as follows. CI test results in other regions can be found at the end of the notebook. \n",
"\n",
"![This us-west-2 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/us-west-2/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"---"
]
},
{
"cell_type": "markdown",
"id": "752aee3a-30ac-43e7-8e29-c12585a89ac1",
"metadata": {
"tags": []
},
"source": [
"## Introduction\n",
"\n",
"The following notebook shows you how to run geospatial workloads in a scale-out fashion by using SageMaker Processing with the geospatial image. In this example, Sentinel-2 data will be selected and then processed via a SageMaker Processing job to calculate the normalized difference vegetation index (NDVI)."
]
},
{
"cell_type": "markdown",
"id": "c2532ccf-6ae8-41d9-bac9-c4e043bb3edb",
"metadata": {
"tags": []
},
"source": [
"## Overview on SageMaker Processing\n",
"\n",
"The following diagram shows how Amazon SageMaker spins up a Processing job. Amazon SageMaker takes your script, copies your data from Amazon Simple Storage Service (Amazon S3), and then pulls a processing container. For geospatial custom operations, AWS provides purpose-built container with commonly used open source geospatial libraries.\n",
"\n",
"The underlying infrastructure for a Processing job is fully managed by Amazon SageMaker. Cluster resources are provisioned for the duration of your job, and cleaned up when a job completes. The output of the Processing job is stored in the Amazon S3 bucket you specified.\n",
"\n",
"![processing overview](https://docs.aws.amazon.com/images/sagemaker/latest/dg/images/Processing-1.png)\n",
"\n",
"### Documentation on SageMaker Processing\n",
"\n",
"- https://docs.aws.amazon.com/sagemaker/latest/dg/geospatial-custom-operations.html\n",
"- https://sagemaker.readthedocs.io/en/stable/api/training/processing.html"
]
},
{
"cell_type": "markdown",
"id": "789f0f3f-7a2e-449a-a81c-fb71e749b759",
"metadata": {},
"source": [
"## Prerequisites\n",
"\n",
"This notebook runs with the Geospatial 1.0 kernel with a `ml.geospatial.interactive` instance. Note that the following policies need to be attached to the execution role that you used to run this notebook:\n",
"- AmazonSageMakerFullAccess\n",
"- AmazonSageMakerGeospatialFullAccess\n",
"\n",
"You can see the policies attached to the role in the IAM console under the permissions tab. If required, add the roles using the 'Add Permissions' button.\n",
"\n",
"In addition to these policies, ensure that the execution role's trust policy allows the SageMaker-GeoSpatial service to assume the role. This can be done by adding the following trust policy using the 'Trust relationships' tab:\n",
"\n",
"```\n",
"{\n",
" \"Version\": \"2012-10-17\",\n",
" \"Statement\": [\n",
" {\n",
" \"Effect\": \"Allow\",\n",
" \"Principal\": {\n",
" \"Service\": [\n",
" \"sagemaker.amazonaws.com\",\n",
" \"sagemaker-geospatial.amazonaws.com\"\n",
" ]\n",
" },\n",
" \"Action\": \"sts:AssumeRole\"\n",
" }\n",
" ]\n",
"}\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "a75702ea-c9d6-49c1-9500-4decbab4a5a4",
"metadata": {},
"source": [
"## Import SageMaker geospatial capabilities SDK"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0609ddbc-498a-44c5-b43d-4a39f2a8a484",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import boto3\n",
"import sagemaker\n",
"import json\n",
"import sagemaker_geospatial_map\n",
"\n",
"session = boto3.Session()\n",
"execution_role = sagemaker.get_execution_role()\n",
"geospatial_client = session.client(service_name=\"sagemaker-geospatial\")"
]
},
{
"cell_type": "markdown",
"id": "275c0569-3dcd-4e31-ad36-bf0edc24c24b",
"metadata": {},
"source": [
"## Query the Sentinel-2 raster data collection using SearchRasterDataCollection\n",
"\n",
"With `search_raster_data_collection` you can query supported raster data collections. This example uses data that's pulled from Sentinel-2 satellites. The area of interest (AreaOfInterest) specified is western Idaho, and the time range (TimeRangeFilter) is January 1, 2022 to December 30, 2022.\n",
"\n",
"In following code examples you use the ARN associated with Sentinel-2 raster data collection, `arn:aws:sagemaker-geospatial:us-west-2:378778860802:raster-data-collection/public/nmqj48dcu3g7ayw8`.\n",
"\n",
"A search_raster_data_collection API request requires two parameters:\n",
"- `Arn`: The Amazon name resource (ARN) that corresponds to the raster data collection that you want to query.\n",
"- `RasterDataCollectionQuery`: The RasterDataCollectionQuery parameter, which contains the area of interest as well as the desired time range."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "eceec6fd-15d1-4050-b53d-632d85e38f7d",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"search_params = {\n",
" \"Arn\": \"arn:aws:sagemaker-geospatial:us-west-2:378778860802:raster-data-collection/public/nmqj48dcu3g7ayw8\", # Sentinel-2 L2A data\n",
" \"RasterDataCollectionQuery\": {\n",
" \"AreaOfInterest\": {\n",
" \"AreaOfInterestGeometry\": {\n",
" \"PolygonGeometry\": {\n",
" \"Coordinates\": [\n",
" [\n",
" [-117.04389469702484, 43.734007425992814],\n",
" [-117.04389469702484, 43.70389023789181],\n",
" [-116.97173284570357, 43.70389023789181],\n",
" [-116.97173284570357, 43.734007425992814],\n",
" [-117.04389469702484, 43.734007425992814],\n",
" ]\n",
" ]\n",
" }\n",
" }\n",
" },\n",
" \"TimeRangeFilter\": {\n",
" \"StartTime\": \"2022-01-01T00:00:00Z\",\n",
" \"EndTime\": \"2022-12-31T23:59:59Z\",\n",
" },\n",
" \"PropertyFilters\": {\n",
" \"Properties\": [{\"Property\": {\"EoCloudCover\": {\"LowerBound\": 0.0, \"UpperBound\": 2.0}}}],\n",
" \"LogicalOperator\": \"AND\",\n",
" },\n",
" },\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "492a1d92-f923-4aba-8f7b-545f145d4951",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"items = []\n",
"next_token = True\n",
"while next_token:\n",
" search_result = geospatial_client.search_raster_data_collection(**search_params)\n",
" for item in search_result[\"Items\"]:\n",
" items.append(item)\n",
" next_token = search_result.get(\"NextToken\")\n",
" search_params[\"NextToken\"] = next_token\n",
"\n",
"print(\n",
" \"Found {} Sentinel-2 scenes for provided AOI, property filters and time range\".format(\n",
" len(items)\n",
" )\n",
")"
]
},
{
"cell_type": "markdown",
"id": "f5880b96-0493-4937-ad1e-e86369872c37",
"metadata": {},
"source": [
"## Create manifest file\n",
"\n",
"When you run a processing job, you must specify a data input from Amazon S3. The input data type can either be a manifest file, which then points to the individual data files. You can also add a prefix to each file that you want processed. The following code example defines the folder where your manifest files will be generated."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "569385bf-f460-4561-92ef-cd40a5fc8e0e",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"def s2_item_to_relative_metadata_url(item):\n",
" parts = item[\"Assets\"][\"visual\"][\"Href\"].split(\"/\")\n",
" tile_prefix = parts[4:-1]\n",
" return \"{}/{}.json\".format(\"/\".join(tile_prefix), item[\"Id\"])\n",
"\n",
"\n",
"manifest = [{\"prefix\": \"s3://sentinel-cogs/sentinel-s2-l2a-cogs/\"}]\n",
"\n",
"for item in items:\n",
" manifest.append(s2_item_to_relative_metadata_url(item))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e6dd2431-c7f8-4d70-b546-02f8f2a0ce08",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# show first 5 entries in manifest\n",
"manifest[0:5]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bf5e4476-0e6e-46d0-bc1b-7b1f463dee03",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sagemaker_session = sagemaker.Session()\n",
"\n",
"s3_bucket_name = sagemaker_session.default_bucket()\n",
"s3_prefix = \"processing-geospatial-ndvi-example\"\n",
"s3_key_manifest = f\"{s3_prefix}/manifest.json\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cfc01837-0f79-4e06-b3fc-7d866066bcf7",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"s3 = boto3.resource(\"s3\")\n",
"\n",
"s3object = s3.Object(s3_bucket_name, s3_key_manifest)\n",
"response = s3object.put(Body=(bytes(json.dumps(manifest).encode(\"UTF-8\"))))"
]
},
{
"cell_type": "markdown",
"id": "ce6c5b6b-3b7d-4b65-94ac-209304570a6c",
"metadata": {},
"source": [
"## Create Processing Job entry script (NDVI calculation)\n",
"\n",
"Amazon SageMaker Studio supports the use of the %%writefile cell magic command. After running a cell with this command, its contents will be saved to your local Studio directory. The code below is specific to calculating NDVI but can be replaced by any business logic."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "265b459b-3d9b-47a4-bd85-822020b34755",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%writefile compute_ndvi.py\n",
"\n",
"import os\n",
"import pickle\n",
"import sys\n",
"import subprocess\n",
"import json\n",
"import rioxarray\n",
"\n",
"if __name__ == \"__main__\":\n",
" print(\"Starting processing\")\n",
"\n",
" input_data_path = \"/opt/ml/processing/input_data/\"\n",
" input_files = []\n",
"\n",
" for current_path, sub_dirs, files in os.walk(input_data_path):\n",
" for file in files:\n",
" if file.endswith(\".json\"):\n",
" input_files.append(os.path.join(current_path, file))\n",
"\n",
" print(\"Received {} input_files: {}\".format(len(input_files), input_files))\n",
"\n",
" items = []\n",
" for input_file in input_files:\n",
" full_file_path = os.path.join(input_data_path, input_file)\n",
" with open(full_file_path, \"r\") as f:\n",
" items.append(json.load(f))\n",
"\n",
" for item in items:\n",
" print(\"Computing NDVI for {}\".format(item[\"id\"]))\n",
" red_uri = item[\"assets\"][\"red\"][\"href\"]\n",
" nir_uri = item[\"assets\"][\"nir\"][\"href\"]\n",
"\n",
" red = rioxarray.open_rasterio(red_uri, masked=True)\n",
" nir = rioxarray.open_rasterio(nir_uri, masked=True)\n",
"\n",
" ndvi = (nir - red) / (nir + red)\n",
"\n",
" file_name = \"ndvi_\" + item[\"id\"] + \".tif\"\n",
" output_path = \"/opt/ml/processing/output_data\"\n",
" output_file_path = f\"{output_path}/{file_name}\"\n",
"\n",
" ndvi.rio.to_raster(output_file_path)\n",
" print(\"Written output:\", output_file_path)"
]
},
{
"cell_type": "markdown",
"id": "a1dfcfe4-46d8-4e3b-afe6-d57081c3212d",
"metadata": {},
"source": [
"## Setup and execute Processing Job\n",
"\n",
"This notebook uses the [ScriptProcessor](https://sagemaker.readthedocs.io/en/stable/api/training/processing.html#sagemaker.processing.ScriptProcessor) class that is available via the Amazon SageMaker Python SDK. First, you need to create an instance of the class, and then you can start your Processing job by using the `.run()` method."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6e07a477-28d7-4623-9457-5789d2a1dd8e",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import sagemaker\n",
"from sagemaker import get_execution_role\n",
"from sagemaker.sklearn.processing import ScriptProcessor\n",
"from sagemaker.processing import ProcessingInput, ProcessingOutput\n",
"\n",
"region = sagemaker.Session().boto_region_name\n",
"role = get_execution_role()\n",
"\n",
"geospatial_image_uri = (\n",
" \"081189585635.dkr.ecr.us-west-2.amazonaws.com/sagemaker-geospatial-v1-0:latest\"\n",
")\n",
"processor = ScriptProcessor(\n",
" command=[\"python3\"],\n",
" image_uri=geospatial_image_uri,\n",
" role=role,\n",
" instance_count=5,\n",
" instance_type=\"ml.m5.xlarge\",\n",
" base_job_name=\"geospatial-processing-example-ndvi\",\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "44f4ac52-d44b-49de-8734-b95dd114aed8",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"s3_manifest_url = f\"s3://{s3_bucket_name}/{s3_key_manifest}\"\n",
"s3_output_prefix_url = f\"s3://{s3_bucket_name}/{s3_prefix}/output\"\n",
"\n",
"processor.run(\n",
" code=\"compute_ndvi.py\",\n",
" inputs=[\n",
" ProcessingInput(\n",
" source=s3_manifest_url,\n",
" destination=\"/opt/ml/processing/input_data/\",\n",
" s3_data_type=\"ManifestFile\",\n",
" s3_data_distribution_type=\"ShardedByS3Key\",\n",
" ),\n",
" ],\n",
" outputs=[\n",
" ProcessingOutput(source=\"/opt/ml/processing/output_data/\", destination=s3_output_prefix_url)\n",
" ],\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "172f6546-4a79-42d1-95cf-66c547712f07",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"preprocessing_job_descriptor = processor.jobs[-1].describe()\n",
"s3_output_uri = preprocessing_job_descriptor[\"ProcessingOutputConfig\"][\"Outputs\"][0][\"S3Output\"][\n",
" \"S3Uri\"\n",
"]\n",
"s3_output_uri"
]
},
{
"cell_type": "markdown",
"id": "4e434cfb-8335-4aa9-8c96-6c4e0e60a154",
"metadata": {},
"source": [
"## Visualizing output\n",
"\n",
"After the processing job is completed, you can visualize the data that has been created as output. In this example, we will select a few samples for visualization."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cc240f85-7e16-448a-9103-f42336b0a230",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import rioxarray\n",
"\n",
"samples = [\n",
" \"S2A_11TNJ_20220312_0_L2A\",\n",
" \"S2B_11TNJ_20220615_0_L2A\",\n",
" \"S2A_11TNJ_20220710_0_L2A\",\n",
" \"S2B_11TNJ_20220814_0_L2A\",\n",
" \"S2B_11TNJ_20220923_0_L2A\",\n",
"]\n",
"\n",
"example_rasters = []\n",
"for sample_id in samples:\n",
" example_rasters.append(\n",
" (sample_id, rioxarray.open_rasterio(f\"{s3_output_uri}/ndvi_{sample_id}.tif\"))\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "28775bfc-1e3e-41a8-90f6-a62723e8c2f1",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"for sample_id, raster in example_rasters:\n",
" plt.figure(figsize=(7, 7))\n",
" ax = plt.axes()\n",
" # clip to an area in the scene\n",
" clipped = raster.rio.clip_box(\n",
" minx=500000,\n",
" miny=4800000.0,\n",
" maxx=540000,\n",
" maxy=4840000.0,\n",
" )\n",
" clipped.plot(ax=ax, cmap=\"RdYlGn\", vmin=-1, vmax=1)\n",
" month = sample_id.split(\"_\")[2][4:6]\n",
" ax.set_title(f\"Example: NDVI for {month}/2022\")\n",
" plt.show()"
]
},
{
"cell_type": "markdown",
"id": "3068aad0-a5f7-4fe7-a01b-2a8f8712e272",
"metadata": {},
"source": [
"## Notebook CI Test Results\n",
"\n",
"This notebook was tested in multiple regions. The test results are as follows, except for us-west-2 which is shown at the top of the notebook.\n",
"\n",
"![This us-east-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/us-east-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This us-east-2 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/us-east-2/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This us-west-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/us-west-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This ca-central-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/ca-central-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This sa-east-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/sa-east-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This eu-west-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/eu-west-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This eu-west-2 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/eu-west-2/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This eu-west-3 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/eu-west-3/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This eu-central-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/eu-central-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This eu-north-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/eu-north-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This ap-southeast-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/ap-southeast-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This ap-southeast-2 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/ap-southeast-2/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This ap-northeast-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/ap-northeast-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This ap-northeast-2 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/ap-northeast-2/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n",
"\n",
"![This ap-south-1 badge failed to load. Check your device's internet connectivity, otherwise the service is currently unavailable](https://h75twx4l60.execute-api.us-west-2.amazonaws.com/sagemaker-nb/ap-south-1/sagemaker-geospatial|processing-geospatial-ndvi|geospatial-processing-ndvi-intro.ipynb)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "75a2bdf8-35be-4f1a-aec3-b3122a541387",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"availableInstances": [
{
"_defaultOrder": 0,
"_isFastLaunch": true,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 4,
"name": "ml.t3.medium",
"vcpuNum": 2
},
{
"_defaultOrder": 1,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 8,
"name": "ml.t3.large",
"vcpuNum": 2
},
{
"_defaultOrder": 2,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 16,
"name": "ml.t3.xlarge",
"vcpuNum": 4
},
{
"_defaultOrder": 3,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.t3.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 4,
"_isFastLaunch": true,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 8,
"name": "ml.m5.large",
"vcpuNum": 2
},
{
"_defaultOrder": 5,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 16,
"name": "ml.m5.xlarge",
"vcpuNum": 4
},
{
"_defaultOrder": 6,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.m5.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 7,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 64,
"name": "ml.m5.4xlarge",
"vcpuNum": 16
},
{
"_defaultOrder": 8,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 128,
"name": "ml.m5.8xlarge",
"vcpuNum": 32
},
{
"_defaultOrder": 9,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 192,
"name": "ml.m5.12xlarge",
"vcpuNum": 48
},
{
"_defaultOrder": 10,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 256,
"name": "ml.m5.16xlarge",
"vcpuNum": 64
},
{
"_defaultOrder": 11,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 384,
"name": "ml.m5.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 12,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 8,
"name": "ml.m5d.large",
"vcpuNum": 2
},
{
"_defaultOrder": 13,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 16,
"name": "ml.m5d.xlarge",
"vcpuNum": 4
},
{
"_defaultOrder": 14,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.m5d.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 15,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 64,
"name": "ml.m5d.4xlarge",
"vcpuNum": 16
},
{
"_defaultOrder": 16,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 128,
"name": "ml.m5d.8xlarge",
"vcpuNum": 32
},
{
"_defaultOrder": 17,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 192,
"name": "ml.m5d.12xlarge",
"vcpuNum": 48
},
{
"_defaultOrder": 18,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 256,
"name": "ml.m5d.16xlarge",
"vcpuNum": 64
},
{
"_defaultOrder": 19,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 384,
"name": "ml.m5d.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 20,
"_isFastLaunch": false,
"category": "General purpose",
"gpuNum": 0,
"hideHardwareSpecs": true,
"memoryGiB": 0,
"name": "ml.geospatial.interactive",
"supportedImageNames": [
"sagemaker-geospatial-v1-0"
],
"vcpuNum": 0
},
{
"_defaultOrder": 21,
"_isFastLaunch": true,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 4,
"name": "ml.c5.large",
"vcpuNum": 2
},
{
"_defaultOrder": 22,
"_isFastLaunch": false,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 8,
"name": "ml.c5.xlarge",
"vcpuNum": 4
},
{
"_defaultOrder": 23,
"_isFastLaunch": false,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 16,
"name": "ml.c5.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 24,
"_isFastLaunch": false,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.c5.4xlarge",
"vcpuNum": 16
},
{
"_defaultOrder": 25,
"_isFastLaunch": false,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 72,
"name": "ml.c5.9xlarge",
"vcpuNum": 36
},
{
"_defaultOrder": 26,
"_isFastLaunch": false,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 96,
"name": "ml.c5.12xlarge",
"vcpuNum": 48
},
{
"_defaultOrder": 27,
"_isFastLaunch": false,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 144,
"name": "ml.c5.18xlarge",
"vcpuNum": 72
},
{
"_defaultOrder": 28,
"_isFastLaunch": false,
"category": "Compute optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 192,
"name": "ml.c5.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 29,
"_isFastLaunch": true,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 16,
"name": "ml.g4dn.xlarge",
"vcpuNum": 4
},
{
"_defaultOrder": 30,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.g4dn.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 31,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 64,
"name": "ml.g4dn.4xlarge",
"vcpuNum": 16
},
{
"_defaultOrder": 32,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 128,
"name": "ml.g4dn.8xlarge",
"vcpuNum": 32
},
{
"_defaultOrder": 33,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 4,
"hideHardwareSpecs": false,
"memoryGiB": 192,
"name": "ml.g4dn.12xlarge",
"vcpuNum": 48
},
{
"_defaultOrder": 34,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 256,
"name": "ml.g4dn.16xlarge",
"vcpuNum": 64
},
{
"_defaultOrder": 35,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 61,
"name": "ml.p3.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 36,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 4,
"hideHardwareSpecs": false,
"memoryGiB": 244,
"name": "ml.p3.8xlarge",
"vcpuNum": 32
},
{
"_defaultOrder": 37,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 8,
"hideHardwareSpecs": false,
"memoryGiB": 488,
"name": "ml.p3.16xlarge",
"vcpuNum": 64
},
{
"_defaultOrder": 38,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 8,
"hideHardwareSpecs": false,
"memoryGiB": 768,
"name": "ml.p3dn.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 39,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 16,
"name": "ml.r5.large",
"vcpuNum": 2
},
{
"_defaultOrder": 40,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.r5.xlarge",
"vcpuNum": 4
},
{
"_defaultOrder": 41,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 64,
"name": "ml.r5.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 42,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 128,
"name": "ml.r5.4xlarge",
"vcpuNum": 16
},
{
"_defaultOrder": 43,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 256,
"name": "ml.r5.8xlarge",
"vcpuNum": 32
},
{
"_defaultOrder": 44,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 384,
"name": "ml.r5.12xlarge",
"vcpuNum": 48
},
{
"_defaultOrder": 45,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 512,
"name": "ml.r5.16xlarge",
"vcpuNum": 64
},
{
"_defaultOrder": 46,
"_isFastLaunch": false,
"category": "Memory Optimized",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 768,
"name": "ml.r5.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 47,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 16,
"name": "ml.g5.xlarge",
"vcpuNum": 4
},
{
"_defaultOrder": 48,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.g5.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 49,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 64,
"name": "ml.g5.4xlarge",
"vcpuNum": 16
},
{
"_defaultOrder": 50,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 128,
"name": "ml.g5.8xlarge",
"vcpuNum": 32
},
{
"_defaultOrder": 51,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 1,
"hideHardwareSpecs": false,
"memoryGiB": 256,
"name": "ml.g5.16xlarge",
"vcpuNum": 64
},
{
"_defaultOrder": 52,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 4,
"hideHardwareSpecs": false,
"memoryGiB": 192,
"name": "ml.g5.12xlarge",
"vcpuNum": 48
},
{
"_defaultOrder": 53,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 4,
"hideHardwareSpecs": false,
"memoryGiB": 384,
"name": "ml.g5.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 54,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 8,
"hideHardwareSpecs": false,
"memoryGiB": 768,
"name": "ml.g5.48xlarge",
"vcpuNum": 192
},
{
"_defaultOrder": 55,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 8,
"hideHardwareSpecs": false,
"memoryGiB": 1152,
"name": "ml.p4d.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 56,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 8,
"hideHardwareSpecs": false,
"memoryGiB": 1152,
"name": "ml.p4de.24xlarge",
"vcpuNum": 96
},
{
"_defaultOrder": 57,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 32,
"name": "ml.trn1.2xlarge",
"vcpuNum": 8
},
{
"_defaultOrder": 58,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 512,
"name": "ml.trn1.32xlarge",
"vcpuNum": 128
},
{
"_defaultOrder": 59,
"_isFastLaunch": false,
"category": "Accelerated computing",
"gpuNum": 0,
"hideHardwareSpecs": false,
"memoryGiB": 512,
"name": "ml.trn1n.32xlarge",
"vcpuNum": 128
}
],
"instance_type": "ml.geospatial.interactive",
"kernelspec": {
"display_name": "Python 3 (Geospatial 1.0)",
"language": "python",
"name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-west-2:081189585635:image/sagemaker-geospatial-v1-0"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}