Vertex AI Platform: Qwik Start

Join Sign in

Vertex AI Platform: Qwik Start

1 hour 1 Credit


Google Cloud Skills Boost logo


This lab will give you hands-on practice with TensorFlow 2.x model training, both locally and on AI Platform. After training, you will learn how to deploy your model to Vertex AI Platform for serving (prediction). You'll train your model to predict income category of a person using the United States Census Income Dataset.

This lab gives you an introductory, end-to-end experience of training and prediction on Vertex AI Platform. The lab will use a census dataset to:

  • Create a TensorFlow 2.x training application and validate it locally.
  • Run your training job on a single worker instance in the cloud.
  • Deploy a model to support prediction.
  • Request an online prediction and see the response.

What you will build

The sample builds a classification model for predicting income category based on United States Census Income Dataset. The two income categories (also known as labels) are:

  • >50K — Greater than 50,000 dollars
  • <=50K — Less than or equal to 50,000 dollars

The sample defines the model using the Keras Sequential API. The sample defines the data transformations particular to the census dataset, then assigns these (potentially) transformed features to either the DNN or the linear portion of the model.


Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.

This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.

What you need

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
  • Time to complete the lab.

Note: If you already have your own personal Google Cloud account or project, do not use it for this lab.

Note: If you are using a Chrome OS device, open an Incognito window to run this lab.

How to start your lab and sign in to the Google Cloud Console

  1. Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is a panel populated with the temporary credentials that you must use for this lab.

    Open Google Console

  2. Copy the username, and then click Open Google Console. The lab spins up resources, and then opens another tab that shows the Sign in page.

    Sign in

    Tip: Open the tabs in separate windows, side-by-side.

  3. In the Sign in page, paste the username that you copied from the left panel. Then copy and paste the password.

    Important: You must use the credentials from the left panel. Do not use your Google Cloud Training credentials. If you have your own Google Cloud account, do not use it for this lab (avoids incurring charges).

  4. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Cloud Console opens in this tab.

Launch Vertex AI Platform Notebooks

To launch Notebooks with Vertex AI:

  1. Click on the Navigation Menu and navigate to Vertex AI, then to Workbench.

  2. On the Notebook instances page, click New Notebook.

  3. In the Customize instance menu, select TensorFlow Enterprise and choose the latest version of TensorFlow Enterprise 2.x (with LTS) > Without GPUs.

New instance, TensorFlow 2.x

  1. In the New notebook instance dialog, click the pencil icon to Edit instance properties.

  2. For Instance name, enter a name for your instance.

  3. For Region, select us-central1 and for Zone, select a zone within the selected region.

  4. Scroll down to Machine configuration and select n1-standard-2 for Machine type.

  5. Leave the remaining fields with their default and click Create.

After a few minutes, the Vertex AI console will display your instance name, followed by Open JupyterLab.

  1. Click Open JupyterLab. A JupyterLab window will open in a new tab.


Clone the example repo within your Vertex AI Platform Notebooks instance

To clone the training-data-analyst notebook in your JupyterLab instance:

  1. In JupyterLab, click the Terminal icon to open a new terminal.

Open Terminal

  1. At the command-line prompt, type in the following command and press Enter.

git clone
  1. Confirm that you have cloned the repository by double clicking on the training-data-analyst directory and ensuring that you can see its contents. The files for all the Jupyter notebook-based labs throughout this course are available in this directory.

Training data analyst repository

Navigate to the example notebook

In Vertex AI Platform Notebooks, navigate to training-data-analyst/self-paced-labs/ai-platform-qwikstart and open ai_platform_qwik_start.ipynb.

Clear all the cells in the notebook (on the notebook toolbar, navigate to Edit > Clear All Outputs) and then Run the cells one by one.

When prompted, come back to these instructions to check your progress.

Run your training job in the cloud

Test Completed Tasks - Step 3.1

Click Check my progress to verify your performed task.

Set up a Cloud Storage bucket.

Click Check my progress to verify your performed task.

Upload the data files to your Cloud Storage bucket.

Test Completed Task - Step 3.2

Click Check my progress to verify your performed task.

Run a single-instance trainer in the cloud.

Test Completed Tasks - Step 3.3

Click Check my progress to verify your performed task.

Create an Vertex AI Platform model.

Click Check my progress to verify your performed task.

Create a version v1 of your model.

Test your Understanding

Below are multiple choice questions to reinforce your understanding of this lab's concepts. Answer them to the best of your abilities.


In this lab you've learned how to train a TensorFlow model both locally and on AI Platform, and then how to use your trained model for prediction.

38616f8aa634e047.png c5c398f6ade6aa06.png ML-Language-Processing-badge ML-Image-Processing-badge.png skills_explainable-ai.png

Finish your quest

This self-paced lab is part of the Qwiklabs Machine Learning APIs, Baseline: Data, ML, AI, Intro to ML: Language Processing, Intro to ML: Image Processing and Explore Machine Learning Models with Explainable AI Quests. A Quest is a series of related labs that form a learning path. Completing a Quest earns you a badge to recognize your achievement. You can make your badge (or badges) public and link to them in your online resume or social media account. Enroll in a Quest and get immediate completion credit if you've taken this lab. See other available Qwiklabs Quests.

Take your next lab

Try out another lab on Machine Learning APIs, like Extract, Analyze, and Translate Text from Images with the Cloud ML APIs or Awwvision: Cloud Vision API from a Kubernetes Cluster.

This lab is also part of a series of labs called Qwik Starts. These labs are designed to give you a little taste of the many features available with Google Cloud. Search for "Qwik Starts" in the lab catalog to find the next lab you'd like to take!

Next steps

Google Cloud Training & Certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated: May 04, 2022
Lab Last Tested: May 04, 2022

Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.