Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erfahren Sie, wie Sie ein Modell, das Sie nicht mehr benötigen, aus der Vertex AI Model Registry löschen.
Wenn Sie ein BigQuery ML-Modell aus der Vertex AI Model Registry löschen möchten, müssen Sie es zuerst aus BigQuery ML löschen. Weitere Informationen finden Sie unter BigQuery ML und Vertex AI Model Registry.
Wenn Sie ein Modell löschen möchten, das auf einem Endpunkt bereitgestellt wird, müssen Sie zuerst die Bereitstellung aufheben. Andernfalls können Sie das Modell nicht löschen.
Modell löschen
Console
Rufen Sie in der Google Cloud Console im Bereich „Vertex AI“ die Seite Model Registry auf.
Wählen Sie im Modell, das Sie löschen möchten, Weitere Aktionen aus.
more_vert
Wählen Sie Modell löschen aus.
Wenn Sie das Modell löschen, werden alle zugehörigen Modellversionen und -bewertungen aus Ihrem Google Cloud -Projekt gelöscht.
Klicken Sie im Bestätigungsbildschirm auf Löschen.
gcloud
Ersetzen Sie folgende Werte, bevor sie einen der Befehlsdaten verwenden:
Löschen Sie ein Modell mit dem Vertex AI SDK für Python.
Python
fromgoogle.cloudimportaiplatformdefdelete_model_sample(model_id:str,project:str,location:str):""" Delete a Model resource. Args: model_id: The ID of the model to delete. Parent resource name of the model is also accepted. project: The project. location: The region name. Returns None. """# Initialize the client.aiplatform.init(project=project,location=location)# Get the model with the ID 'model_id'. The parent_name of Model resource can be also# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'model=aiplatform.Model(model_name=model_id)# Delete the model.model.delete()
Modellversion löschen
Console
Rufen Sie in der Google Cloud Console im Bereich „Vertex AI“ die Seite Model Registry auf.
fromgoogle.cloudimportaiplatformdefdelete_model_version_sample(model_id:str,version_id:str,project:str,location:str):""" Delete a Model version. Args: model_id: The ID of the model to delete. Parent resource name of the model is also accepted. version_id: The version ID or version alias of the model to delete. project: The project ID. location: The region name. Returns None. """# Initialize the client.aiplatform.init(project=project,location=location)# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'model_registry=aiplatform.models.ModelRegistry(model=model_id)# Delete the model version with the version 'version'.model_registry.delete_version(version=version_id)
Modellversion mit dem Standardalias löschen
Console
Wählen Sie in Model Registry den Modellnamen aus, um die Modellversionen aufzurufen.
Wählen Sie die gewünschte Version aus, klicken Sie auf die Schaltfläche Aktionenmore_vert und dann auf Löschen.
Eine Warnung wird geöffnet, da Sie versuchen, die Standard-Aliasversion zu löschen. Legen Sie zuerst andere Version als Standard fest.
Wählen Sie im Drop-down-Menü die Version aus, die Sie als Standard für das Modell festlegen möchten.
Klicken Sie auf dem Bestätigungsbildschirm auf Festlegen und löschen.
API
Python
fromtypingimportListfromgoogle.cloudimportaiplatformdefdelete_aliases_model_version_sample(model_id:str,version_aliases:List[str],version_id:str,project:str,location:str,):""" Delete aliases to a model version. Args: model_id: The ID of the model. version_aliases: The version aliases to assign. version_id: The version ID of the model to assign the aliases to. project: The project ID. location: The region name. Returns None. """# Initialize the client.aiplatform.init(project=project,location=location)# Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also# 'projects/<your-project-id>/locations/<your-region>/models/<your-model-id>'model_registry=aiplatform.models.ModelRegistry(model=model_id)# Remove the version aliases to the model version with the version 'version'.model_registry.remove_version_aliases(target_aliases=version_aliases,version=version_id)
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-02 (UTC)."],[],[],null,["# Delete a model from Vertex AI Model Registry\n\nLearn how to delete a model you no longer need from the Vertex AI Model Registry.\n\nIf you want to delete a BigQuery ML from Vertex AI Model Registry,\nyou must first delete it from BigQuery ML. To learn more,\nsee [BigQuery ML and Vertex AI Model Registry](/bigquery-ml/docs/managing-models-vertex).\n\nIf you want to delete a model that is deployed to an endpoint, you\nneed to undeploy it first. Otherwise, you are unable to delete the model.\n\nDelete a model\n--------------\n\n### Console\n\n1. Go to the **Model Registry** page from the Vertex AI section\n in the Google Cloud console.\n\n [Go to the Model Registry page](https://console.cloud.google.com/vertex-ai/models)\n2. Select **More actions** from the model you want to delete.\n more_vert\n\n3. Select **Delete model**.\n When you delete the model, all associated model versions and evaluations are\n deleted from your Google Cloud project.\n\n4. Click **Delete** on the confirmation screen.\n\n### gcloud\n\n\nBefore using any of the command data below,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eMODEL_ID\u003c/var\u003e: The ID of your model.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifiers).\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Your project's region. For example, `us-central1`.\n\n\nExecute the\n\nfollowing\n\ncommand:\n\n#### Linux, macOS, or Cloud Shell\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete MODEL_ID \\\n --project=PROJECT_ID \\\n --region=LOCATION\n```\n\n#### Windows (PowerShell)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete MODEL_ID `\n --project=PROJECT_ID `\n --region=LOCATION\n```\n\n#### Windows (cmd.exe)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete MODEL_ID ^\n --project=PROJECT_ID ^\n --region=LOCATION\n```\n\n\u003cbr /\u003e\n\n### API\n\n\nDelete a model using the Vertex AI SDK for Python.\n\n### Python\n\n\n from google.cloud import aiplatform\n\n\n def delete_model_sample(model_id: str, project: str, location: str):\n \"\"\"\n Delete a Model resource.\n Args:\n model_id: The ID of the model to delete. Parent resource name of the model is also accepted.\n project: The project.\n location: The region name.\n Returns\n None.\n \"\"\"\n # Initialize the client.\n aiplatform.init(project=project, location=location)\n\n # Get the model with the ID 'model_id'. The parent_name of Model resource can be also\n # 'projects/\u003cyour-project-id\u003e/locations/\u003cyour-region\u003e/models/\u003cyour-model-id\u003e'\n model = aiplatform.Model(model_name=model_id)\n\n # Delete the model.\n model.delete()\n\nDelete a model version\n----------------------\n\n### Console\n\n1. Go to the **Model Registry** page from the Vertex AI section\n in the Google Cloud console.\n\n [Go to the Model Registry page](https://console.cloud.google.com/vertex-ai/models)\n2. Expand the model to view its model versions. Select the version that you want to delete.\n\n3. Select the **More actions** from the model version.\n menu more_vert.\n\n4. Select **Delete version**. All associated model evaluations are deleted when you delete your version.\n\n### gcloud\n\n\nBefore using any of the command data below,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eMODEL_VERSION_ID\u003c/var\u003e: The ID of the model version to delete.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifiers).\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: Your project's region. For example, `us-central1`.\n\n\nExecute the\n\nfollowing\n\ncommand:\n\n#### Linux, macOS, or Cloud Shell\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete-version MODEL_VERSION_ID \\\n --project=PROJECT_ID \\\n --region=LOCATION\n```\n\n#### Windows (PowerShell)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete-version MODEL_VERSION_ID `\n --project=PROJECT_ID `\n --region=LOCATION\n```\n\n#### Windows (cmd.exe)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud ai models delete-version MODEL_VERSION_ID ^\n --project=PROJECT_ID ^\n --region=LOCATION\n```\n\n\u003cbr /\u003e\n\n### API\n\n### Python\n\n\n from google.cloud import aiplatform\n\n\n def delete_model_version_sample(\n model_id: str, version_id: str, project: str, location: str\n ):\n \"\"\"\n Delete a Model version.\n Args:\n model_id: The ID of the model to delete. Parent resource name of the model is also accepted.\n version_id: The version ID or version alias of the model to delete.\n project: The project ID.\n location: The region name.\n Returns\n None.\n \"\"\"\n # Initialize the client.\n aiplatform.init(project=project, location=location)\n\n # Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also\n # 'projects/\u003cyour-project-id\u003e/locations/\u003cyour-region\u003e/models/\u003cyour-model-id\u003e'\n model_registry = aiplatform.models.ModelRegistry(model=model_id)\n\n # Delete the model version with the version 'version'.\n model_registry.delete_version(version=version_id)\n\nDelete a model version with the default alias\n---------------------------------------------\n\n### Console\n\n1. From the Model Registry, select the model name to view its model versions.\n2. Select the version that you want, and from the **Actions** button more_vert click **Delete**. A warning opens since you're attempting to delete the default alias version. Set another version as default first.\n3. Select what version you want to make default for the model from the drop-down.\n4. On the confirmation screen, click **Set and delete.**\n\n### API\n\n### Python\n\n\n from typing import List\n\n from google.cloud import aiplatform\n\n\n def delete_aliases_model_version_sample(\n model_id: str,\n version_aliases: List[str],\n version_id: str,\n project: str,\n location: str,\n ):\n \"\"\"\n Delete aliases to a model version.\n Args:\n model_id: The ID of the model.\n version_aliases: The version aliases to assign.\n version_id: The version ID of the model to assign the aliases to.\n project: The project ID.\n location: The region name.\n Returns\n None.\n \"\"\"\n # Initialize the client.\n aiplatform.init(project=project, location=location)\n\n # Initialize the Model Registry resource with the ID 'model_id'.The parent_name of Model resource can be also\n # 'projects/\u003cyour-project-id\u003e/locations/\u003cyour-region\u003e/models/\u003cyour-model-id\u003e'\n model_registry = aiplatform.models.ModelRegistry(model=model_id)\n\n # Remove the version aliases to the model version with the version 'version'.\n model_registry.remove_version_aliases(\n target_aliases=version_aliases, version=version_id\n )"]]