Compare commits

...
Author SHA1 Message Date
Andrew Ferlitsch 97532cf2a5 fix: fine-tuning 2022-09-07 17:25:18 +00:00
Andrew Ferlitsch 463e6a5d1f fix: fine-tuning 2022-09-07 17:23:01 +00:00
4 changed files with 36 additions and 17 deletions
@@ -8,7 +8,7 @@
},
"outputs": [],
"source": [
"# Copyright 2021 Google LLC\n",
"# Copyright 2022 Google LLC\n",
"#\n",
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"# you may not use this file except in compliance with the License.\n",
@@ -44,8 +44,9 @@
" </a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/notebooks/community/ml_ops/stage6/get_started_with_automl_tabular_model_batch.ipynb\">\n",
" Open in Google Cloud Notebooks\n",
" <a href=\"https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https://raw.githubusercontent.com/GoogleCloudPlatform/vertex-ai-samples/main/notebooks/community/ml_ops/stage6/get_started_with_automl_image_model_batch.ipynb\">\n",
" <img src=\"https://lh3.googleusercontent.com/UiNooY4LUgW_oTvpsNhPpQzsstV5W8F7rYgxgGBD85cWJoLmrOzhVs_ksK_vgx40SHs7jCqkTkCk=e14-rj-sc0xffffff-h130-w32\" alt=\"Vertex AI logo\">\n",
" Open in Vertex AI Workbench\n",
" </a>\n",
" </td>\n",
"</table>\n",
@@ -61,7 +62,7 @@
"## Overview\n",
"\n",
"\n",
"This tutorial demonstrates how to use the Vertex SDK to create image classification models and do batch prediction using a Google Cloud [AutoML](https://cloud.google.com/vertex-ai/docs/start/automl-users) model."
"This tutorial demonstrates how to use the Vertex AI SDK to create image classification models and do batch prediction using a Google Cloud [AutoML](https://cloud.google.com/vertex-ai/docs/start/automl-users) model."
]
},
{
@@ -752,7 +753,7 @@
"\n",
"- JSONL\n",
"\n",
"The batch server accepts the following input formats for AutoML image models:\n",
"The batch server accepts the following output formats for AutoML image models:\n",
"\n",
"- JSONL\n",
"\n",
@@ -8,7 +8,7 @@
},
"outputs": [],
"source": [
"# Copyright 2021 Google LLC\n",
"# Copyright 2022 Google LLC\n",
"#\n",
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"# you may not use this file except in compliance with the License.\n",
@@ -786,7 +786,9 @@
"- CSV\n",
"- Big Query table\n",
"\n",
"The batch server accepts the following input formats for AutoML tabular models:\n",
"### Output format for batch prediction jobs\n",
"\n",
"The batch server accepts the following output formats for AutoML tabular models:\n",
"\n",
"- JSONL\n",
"- CSV\n",
@@ -8,7 +8,7 @@
},
"outputs": [],
"source": [
"# Copyright 2021 Google LLC\n",
"# Copyright 2022 Google LLC\n",
"#\n",
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
"# you may not use this file except in compliance with the License.\n",
@@ -731,10 +731,12 @@
"\n",
"### Input format for batch prediction jobs\n",
"\n",
"The batch server accepts the following input formats for AutoML tabular models:\n",
"The batch server accepts the following input formats for AutoML text models:\n",
"\n",
"- JSONL\n",
"\n",
"### Output format for batch prediction jobs\n",
"\n",
"The batch server accepts the following output formats for AutoML text models:\n",
"\n",
"- JSONL\n",
@@ -883,8 +885,6 @@
"source": [
"import json\n",
"\n",
"import tensorflow as tf\n",
"\n",
"gcs_test_item_1 = BUCKET_URI + \"/test1.txt\"\n",
"with open(\"test1.txt\", \"w\") as f:\n",
" f.write(test_item_1 + \"\\n\")\n",
@@ -967,6 +967,17 @@
"batch_predict_job.wait()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "batch_request_wait:mbsdk"
},
"outputs": [],
"source": [
"batch_predict_job.wait()"
]
},
{
"cell_type": "markdown",
"metadata": {
@@ -994,6 +1005,10 @@
},
"outputs": [],
"source": [
"import json\n",
"\n",
"import tensorflow as tf\n",
"\n",
"bp_iter_outputs = batch_predict_job.iter_outputs()\n",
"\n",
"prediction_results = list()\n",
@@ -741,13 +741,16 @@
"\n",
"### Input format for batch prediction jobs\n",
"\n",
"The batch server accepts the following input formats:\n",
"The batch server accepts the following input formats for custom image models:\n",
"\n",
"- JSONL\n",
"- CSV\n",
"- TFRecords\n",
"- File-List\n",
"- BigQuery table\n",
"\n",
"### Output format for batch prediction jobs\n",
"\n",
"The batch server accepts the following output formats for custom image models:\n",
"\n",
"- JSONL\n",
"\n",
"### Pivot format\n",
"\n",
@@ -1306,8 +1309,6 @@
"source": [
"### Send the prediction request\n",
"\n",
"BLAH\n",
"\n",
"To make a batch prediction request, call the model object's `batch_predict` method with the following parameters: \n",
"- `instances_format`: The format of the batch prediction request file: \"jsonl\", \"csv\", \"bigquery\", \"tf-record\", \"tf-record-gzip\" or \"file-list\"\n",
"- `prediction_format`: The format of the batch prediction response file: \"jsonl\", \"csv\", \"bigquery\", \"tf-record\", \"tf-record-gzip\" or \"file-list\"\n",