Hello custom training: Clean up your project

This page guides you through cleaning up the Google Cloud resources that you created to train your image classification model and serve predictions from it.

This document is part of the "Hello custom training" tutorial, which walks you through using Vertex AI to train an image classification model and serve predictions using the model. In this tutorial, you use Vertex AI's custom training feature to run a TensorFlow Keras training application in one of Vertex AI's pre-built container environments. This custom training job trains a machine learning (ML) model to classify images of flowers by their type. After you train the ML model, the tutorial shows you how to create an endpoint and serve predictions from that endpoint to a simple web app.

This tutorial has several pages:

  1. Setting up your project and environment.

  2. Training a custom image classification model.

  3. Serving predictions from a custom image classification model.

  4. Cleaning up your project.

Each page assumes that you have already performed the instructions from the previous pages of the tutorial.

The rest of this document assumes that you are using the same Cloud Shell environment that you created when following the first page of this tutorial. If your original Cloud Shell session is no longer open, you can return to the environment by doing the following:

  1. In the Cloud Console, activate Cloud Shell.

    Activate Cloud Shell

  2. In the Cloud Shell session, run the following command:

    cd hello-custom-sample
    

Delete Vertex AI resources

This section describes how to delete all of the Vertex AI resources that you created for this tutorial.

Undeploy your model from your endpoint

This section describes how to undeploy your model from your endpoint. You can think about this action as a way of disconnecting your model from your endpoint.

You must follow this section before you can delete your endpoint or delete your model.

  1. In the Google Cloud Console, in the Vertex AI section, go to the Endpoints page.

    Go to Endpoints

  2. Click hello_custom to go to the endpoint details page.

  3. On the row for your model, hello_custom, click Undeploy model .

  4. In the Undeploy model from endpoint dialog, click Undeploy.

Delete your endpoint

Before you follow this section, you must undeploy your model from your endpoint. Afterward, do the following to delete your endpoint:

  1. In the Google Cloud Console, in the Vertex AI section, go to the Endpoints page.

    Go to Endpoints

  2. Find your the row of your endpoint, hello_custom, again. On that row, click View more . Then click Remove endpoint.

  3. In the Remove endpoint dialog, click Confirm.

Delete your model

Before you follow this section, you must undeploy your model from your endpoint. Afterward, do the following to delete your endpoint:

  1. In the Google Cloud Console, in the Vertex AI section, go to the Models page.

    Go to Models

  2. Find your the row of your model, hello_custom. On that row, click View more . Then click Delete model.

  3. In the Delete model dialog, click Delete.

Delete your custom training pipeline and job

Your training pipeline and custom job are just records of the training that happened earlier. If you want to delete your custom job, do the following:

  1. In the Google Cloud Console, in the Vertex AI section, go to the Training pipelines page.

    Go to Training pipelines

  2. Find your the row of your training pipeline, hello_custom. On that row, click View more . Then click Delete training pipeline.

  3. In the Delete training job dialog, click Delete.

  4. To go to the Custom jobs page, click Custom job in the Cloud Console, or click the following link:

    Go to Custom jobs

  5. Find your the row of your custom job, hello_custom-custom-job. On that row, click View more . Then click Delete custom job.

  6. In the Delete training job dialog, click Delete.

Clean up your Cloud Shell session

Cloud Shell incurs no charges, and it automatically deletes your home disk after a period of inactivity. However, if you plan to use Cloud Shell for other purposes in the near future, you might want to manually remove the files that you created for this tutorial.

In your Cloud Shell session, run the following commands:

cd ..
rm -rf hello-custom-sample

Delete your Cloud Storage bucket

In your Cloud Shell session, run the following command:

gsutil -m rm -rf gs://BUCKET_NAME

Replace BUCKET_NAME with the name of the Cloud Storage bucket that you created when reading the first page of this tutorial.

Delete your Cloud Function

In your Cloud Shell session, run the following command:

gcloud functions delete classify_flower --region=us-central1 --quiet

What's next