Get started with Vertex AI TensorBoard

Open source TensorBoard (TB) is a Google open source project for machine learning experiment visualization. Vertex AI TensorBoard is an enterprise-ready managed version of TensorBoard.

Vertex AI TensorBoard provides various detailed visualizations, that includes:

  • Tracking and visualizing metrics such as loss and accuracy over time
  • Visualizing model computational graphs (ops and layers)
  • Viewing histograms of weights, biases, or other tensors as they change over time
  • Projecting embeddings to a lower dimensional space
  • Displaying image, text, and audio samples

In addition to the powerful visualizations from TensorBoard, Vertex AI TensorBoard provides:

  • A persistent, shareable link to your experiment's dashboard

  • A searchable list of all experiments in a project

  • Tight integrations with Vertex AI services for model training

  • Enterprise-grade security, privacy, and compliance

With Vertex AI TensorBoard, you can track, visualize, and compare ML experiments and share them with your team.

Get Started

A Vertex AI TensorBoard instance, which is a regionalized resource storing your Vertex AI TensorBoard experiments, must be created before the experiments can be visualized. You can create multiple instances in a project.

Create a Vertex AI TensorBoard instance

Follow these steps to create a Vertex AI TensorBoard instance using the Cloud console

  1. If you are new to Vertex AI or starting a new project, set up your project and development environment.

  2. In the Vertex AI section of the Google Cloud console, go to the Experiments page.

    Go to the Experiments page

  3. Navigate to the TensorBoard Instances tab.

  4. Click Create at the top of the page.

  5. Select a region from the Region drop-down list.

  6. Modify the TensorBoard instance name field to create a descriptive display name. (optional)

  7. Add a description. (optional)

  8. Click Create to create your TensorBoard instance

create tensorboard instance

Alternatively, you can create a Vertex AI TensorBoard instance from the Google Cloud CLI.

  1. Install the gcloud CLI.

  2. Initialize the Google Cloud CLI by running gcloud init.

  3. Explore the commands to confirm installation.

    gcloud ai tensorboards --help
    

    The commands include create, describe, list, and delete. If needed, you can follow these steps to set default values for your project and region before proceeding.

    Now, you can create a Vertex AI TensorBoard instance.

  4. Authenticate to the gcloud CLI.

    gcloud auth application-default login
    
  5. Create a Vertex AI TensorBoard instance by providing a project name and a display name. This step might take a few minutes to complete for the first time in a project. Make note of the Vertex AI TensorBoard instance name (for example: projects/123/locations/us-central1/tensorboards/456) that is printed at the end of the following command. You will need it in the later steps.

    gcloud ai tensorboards create --display-name DISPLAY_NAME \
      --project PROJECT_NAME
    

    Replace the following:

    • PROJECT_NAME: the project you want to create the TensorBoard instance in

    • DISPLAY_NAME: a descriptive name for the TensorBoard instance

Uploading TensorBoard logs with the Vertex AI TensorBoard Uploader

Vertex AI TensorBoard offers a Python CLI for uploading TensorBoard logs. You can upload logs from any environment which can connect to Google Cloud.

Alternatively, you can upload TensorBoard logs using the Vertex AI TensorBoard REST APIs.

Creating a virtual environment (optional)

Optional, but recommended first step: create a dedicated virtual environment to install the Vertex AI TensorBoard Uploader Python CLI.

python3 -m venv PATH/TO/VIRTUAL/ENVIRONMENT
source PATH/TO/VIRTUAL/ENVIRONMENT/bin/activate

Replace PATH/TO/VIRTUAL/ENVIRONMENT with the path to your dedicated virtual environment.

Install the Vertex AI TensorBoard Uploader through Vertex AI SDK

The uploader needs the latest version of pip in order to get installed properly.

pip install -U pip
pip install google-cloud-aiplatform[tensorboard]

Uploading Vertex AI TensorBoard logs

tb-gcp-uploader --tensorboard_resource_name \
  TENSORBOARD_INSTANCE_NAME \
  --logdir=LOG_DIR \
  --experiment_name=TB_EXPERIMENT_NAME --one_shot=True
  • TENSORBOARD_INSTANCE_NAME: there are two ways to identify the instance name:

    • The full name is printed at the end of the gcloud ai tensorboards create command that you used previously.
    • If the TensorBoard Instance was created using the Cloud console, the TENSORBOARD_INSTANCE_NAME is projects/PROJECT_ID_OR_NUMBER/locations/REGION/tensorboards/TENSORBOARD_INSTANCE_ID

      • To find the TENSORBOARD_INSTANCE_ID, go to the Experiments page Vertex AI section of the Google Cloud console, and then select the TensorBoard Instances tab.

        Go to the Experiments page

create tensorboard instance

  • LOG_DIR: the location of the event logs that resides either in the local file system or Cloud Storage

  • TB_EXPERIMENT_NAME: the name of the experiment, for example test-experiment. The experiment name should be unique within a TensorBoard resource

The uploader CLI by default runs indefinitely, monitoring changes in the LOG_DIR, and uploads newly added logs. --one_shot=True disables the behavior. Run tb-gcp-uploader --help for more information.

View a Vertex AI TensorBoard experiment

In order to access the Vertex AI TensorBoard UI, users need the IAM role "Vertex AI TensorBoard Web App User", which can be granted by the IAM Administrator of the project. Users with the Vertex AI Administrator role also have access.

Use the Google Cloud console

You can view your Vertex AI TensorBoard experiment from the Google Cloud console with the following steps.

  1. In the Vertex AI section of the Google Cloud console, go to the Experiments page.

    Go to the Experiments page

  2. From the experiments tab, scroll or filter the experiments list to find your experiment.

  3. To open the Vertex AI TensorBoard UI, click Open TensorBoard next to your experiment.

view tensorboard

Alternatively, if you use Vertex AI TensorBoard with custom training, select the training job from the Training page. An Open TensorBoard button appears at the top of the Training Job details page.

In addition, when using the TensorBoard Uploader, the CLI outputs a link to the Vertex AI TensorBoard instance in the first few lines of the log where you can view your experiment. For example: View your TensorBoard at https://us-central1.tensorboard.googleusercontent.com/experiment/projects+123+locations+us-central1+tensorboards+4567+experiments+my-experiment-name

What's next