mirror of
https://github.com/GoogleCloudPlatform/vertex-ai-samples.git
synced 2026-09-26 14:42:04 +00:00
fix: address tech writer feedback on the PyTorch container notebook
This commit is contained in:
+21
-12
@@ -55,6 +55,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "tvgnzT1CKxrO"
|
||||
@@ -62,9 +63,9 @@
|
||||
"source": [
|
||||
"## Overview\n",
|
||||
"\n",
|
||||
"Vertex AI provides Docker container images that you run as prebuilt containers for serving predictions and explanations from trained model artifacts. Using prebuilt containers, you can deploy models for prediction quickly and reliably at any scale.\n",
|
||||
"This tutorial demonstrates how to upload and deploy a PyTorch image model using a prebuilt serving container and how to make batch and online and batch predictions.\n",
|
||||
"\n",
|
||||
"This tutorial demonstrates how to deploy a PyTorch image model using a prebuilt Vertex AI container with TorchServe for serving online and batch predictions with minimal configuration.\n",
|
||||
"Vertex AI provides prebuilt containers for serving predictions and explanations from trained model artifacts. Using a pre-built container is generally simpler than creating your own custom container for prediction.\n",
|
||||
"\n",
|
||||
"Learn more about [Pre-built containers for prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers)."
|
||||
]
|
||||
@@ -97,6 +98,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "08d289fa873f"
|
||||
@@ -104,7 +106,7 @@
|
||||
"source": [
|
||||
"### Model\n",
|
||||
"\n",
|
||||
"In this example, you use a pretrained image model [resnet18](https://pytorch.org/vision/master/models/generated/torchvision.models.resnet18.html) from the PyTorch TorchVision."
|
||||
"This tutorial uses a pretrained image model [resnet18](https://pytorch.org/vision/master/models/generated/torchvision.models.resnet18.html) from the PyTorch TorchVision."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -401,6 +403,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "_McUaTTABIqu"
|
||||
@@ -408,7 +411,7 @@
|
||||
"source": [
|
||||
"## Download a pre-trained image model\n",
|
||||
"\n",
|
||||
"For demonstration purposes, this tutorial uses a pretrained image model [resnet18](https://pytorch.org/vision/master/models/generated/torchvision.models.resnet18.html) from the PyTorch TorchVision."
|
||||
"Download the pretrained image model [resnet18](https://pytorch.org/vision/master/models/generated/torchvision.models.resnet18.html) from the PyTorch TorchVision."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -592,6 +595,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "B9Ep0eANl7te"
|
||||
@@ -599,7 +603,7 @@
|
||||
"source": [
|
||||
"## Upload model for deployment\n",
|
||||
"\n",
|
||||
"Next, you upload the model to `Vertex AI Model Registry`, which will create a `Vertex AI Model` resource for your model. You select a PyTorch prebuilt container image from a list of available [PyTorch prebuilt containers](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers#pytorch), and specify the image URI in the parameter `serving_container_image_uri`."
|
||||
"Next, you upload the [model](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.models) to `Vertex AI Model Registry`, which will create a `Vertex AI Model` resource for your model. This tutorial uses the PyTorch v1.11 container, but for your own use case, you can choose from the list of [PyTorch prebuilt containers](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers#pytorch)."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -649,6 +653,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "Dp2oUReOpx7X"
|
||||
@@ -657,7 +662,7 @@
|
||||
"## Make online predictions\n",
|
||||
"\n",
|
||||
"### Download an image dataset\n",
|
||||
"In this example, you use the TensorFlow flowers dataset for the input data for predictions."
|
||||
"In this example, you use the TensorFlow flowers dataset for the input for both online and batch predictions."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -679,6 +684,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "0xRXkbxZqDkc"
|
||||
@@ -686,7 +692,7 @@
|
||||
"source": [
|
||||
"### Get online predictions\n",
|
||||
"\n",
|
||||
"You send an `predict` request with encoded input image data to the `endpoint` and get predictions."
|
||||
"You send a `predict` request with encoded input image data to the `endpoint` and get prediction."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -720,6 +726,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "6o93-TkuqXS-"
|
||||
@@ -729,7 +736,9 @@
|
||||
"\n",
|
||||
"### Create the batch input file\n",
|
||||
"\n",
|
||||
"You create a batch input file in JSONL format and store the input file in your Cloud Storage bucket."
|
||||
"You create a batch input file in JSONL format and store the input file in your Cloud Storage bucket.\n",
|
||||
"\n",
|
||||
"Learn more about [Input data requirements](https://cloud.google.com/vertex-ai/docs/predictions/get-predictions#input_data_requirements)."
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -755,14 +764,13 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "_Ap-UO4tsJiO"
|
||||
},
|
||||
"source": [
|
||||
"### Submit a batch prediction job\n",
|
||||
"\n",
|
||||
"You make a batch prediction by submitting a batch prediction job."
|
||||
"### Submit a batch prediction job"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -786,6 +794,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"id": "2gVBOadysOSY"
|
||||
@@ -793,7 +802,7 @@
|
||||
"source": [
|
||||
"### Get batch predictions\n",
|
||||
"\n",
|
||||
"Next, you get the predictions from the completed batch prediction job. The results are written to the Cloud Storage output bucket you specified in the batch prediction request. You call the method `iter_outputs()` to get a list of each Cloud Storage file generated with the results."
|
||||
"After the batch job completes, the results are written to the Cloud Storage output bucket you specified in the batch request. You call the method `iter_outputs()` to get a list of each Cloud Storage file generated with the results."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user