Model versioning lets you create multiple versions of the same model. With model versioning, you can organize your models in a way that helps navigate and understand which changes had what effect on the models. With Model Registry you can view your models and all of their versions in a single view. You can drill down into specific model versions and see exactly how they performed.
Import a new model version
From the Model Registry, you can import a model as a new version of an existing model.
Console
- In the Google Cloud console, go to the Model Registry page.
Go to Model Registry - On the top of the page, select Import.
- Select Import as new version.
- From the drop-down, select the model this is a new version of. Add an optional version description.
- Optionally set this model as the default version. The default version is preselected whenever the model is used for prediction (although you can still select other versions).
- Select your Region.
- Select Continue.
- From the Model settings, define what container you want to use. You can select to import model artifacts into a new prebuilt container or import into an existing custom container. To learn more about containers, see Import models to Vertex AI.
- Select Continue.
- Optional: Add explainability support to your model.
- Select Import.
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: The project ID.
- LOCATION: The location.
- MODEL_DISPLAY_NAME: The model name.
- ARTIFACT_URI: The path to the directory containing the model artifact and any of its supporting files.
- IMAGE_URI: Docker image to be used as the custom container for serving predictions.
- PARENT_MODEL: The resource name of the model into which to upload the version.
HTTP method and URL:
POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/models:upload
Request JSON body:
{ "model": { "displayName": "MODEL_DISPLAY_NAME", "artifactUri": "ARTIFACT_URI", "containerSpec": { "imageUri": "IMAGE_URI" } }, "parentModel": "PARENT_MODEL" }
To send your request, expand one of these options:
You should receive a successful status code (2xx) and an empty response.
Python
Python
Train a new model version
From the Model Registry, you can train a new version of a model.
Console
From the Model Registry, you can create a version of an existing model. To learn more about how to add or create a model version in your training pipeline, see CustomJob and model upload
- In the Google Cloud console, go to the Model Registry page.
Go to Model Registry - On the top of the page, select Create. Enter the training method details and select the model training method.
- Click Continue.
- Under Model details, select the Train new version option. From the dropdown select the model you are adding a new version to. Add a description of the version. Click Continue.
- From the Compute and pricing section, enter your budget and select Start training when you're ready. When the model training completes, the new version is visible from the Model Registry.
REST
Before using any of the request data, make the following replacements:
- TRAINING_PIPELINE_NAME: A display name for the trainingPipeline
- TRAINING_TASK_INPUT: The training task's parameter(s).
- PARENT_MODEL: The resource name of the model into which to upload the version.
HTTP method and URL:
POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/trainingPipelines
Request JSON body:
{ "displayName": "TRAINING_PIPELINE_NAME", "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/custom_task_1.0.0.yaml", "trainingTaskInputs":"TRAINING_TASK_INPUT" }, "modelToUpload": { "displayName": "MODEL_DISPLAY_NAME", "containerSpec": { "imageUri": "IMAGE_URI" }, }, "parentModel": "PARENT_MODEL",
To send your request, expand one of these options:
You should receive a successful status code (2xx) and an empty response.
Python
Python
How to view a list of all versions of a model
From a model version's details page, you can choose to deploy and test your model, set up batch prediction, and evaluate depending on the model type. You can also view the dataset used to train the model version directly from the version details page.
Console
From the Model Registry, you can view a list of all versions of a model. This can help you gain at a glance insight and helps with model organization.
- In the Google Cloud console, go to the Model Registry page.
Go to Model Registry - Under the Name column, select the name of a model which has multiple versions. The versions page opens.
- A list of all versions and their associated version IDs is displayed.
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: The project ID associated to this model
- LOCATION: The region where you are using Vertex AI.
- MODEL_ID: The ID associated with a specific model.
HTTP method and URL:
GET https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/models/MODEL_ID
To send your request, expand one of these options:
You should receive a successful status code (2xx) and an empty response.
Python
Python
How to view model version details
From the Model Registry you can see your models and all of your model versions. When selecting a model from the Model Registry, the detail page displays model details and specific model version details. From the details screen, you can evaluate and test your model version, run a batch prediction, or deploy the model to an endpoint for online prediction.
Console
Use the following instructions to view your model details page. To view version details, click the version name.
- In the Google Cloud console, go to the Model Registry page.
Go to Model Registry - From the Vertex AI Model Registry, click a model name to open the model details page.
- A list of all versions and their associated version IDs displays. You see model versions separated by row. Model version details include the version ID, the model alias, status, description, and labels.
- To view the details of one of the model versions, select a version ID. The model details page opens
- From the details page you can evaluate, deploy and test, use batch prediction, and take a closer look at the version details. Additionally, from this page you can use Vertex AI Model Evaluation to compare your model versions.
Python
Python