Vorhersagen von einem benutzerdefinierten Modell abrufen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Eine Vorhersage ist die Ausgabe eines trainierten Modells für maschinelles Lernen. Diese Seite bietet einen Überblick über den Workflow zum Abrufen von Vorhersagen aus Ihren Modellen in Vertex AI.
Vertex AI bietet zwei Methoden zum Abrufen von Vorhersagen:
Onlinevorhersagen sind synchrone Anfragen an ein Modell, das in einem endpoint bereitgestellt wird. Entsprechend müssen Sie vor dem Senden einer Anfrage zuerst die Ressource Model auf einem Endpunkt bereitstellen. Dadurch werden dem Modell Rechenressourcen zugeordnet, sodass es Onlinevorhersagen mit niedriger Latenz bereitstellen kann. Verwenden Sie Onlinevorhersagen, wenn Sie Anfragen als Reaktion auf Anwendungseingaben stellen oder wenn zeitnahe Inferenzen erforderlich sind.
Batchvorhersagen sind asynchrone Anfragen an ein Modell, das nicht auf einem Endpunkt bereitgestellt ist. Sie senden die Anfrage (als BatchPredictionsJob-Ressource) direkt an die Model-Ressource. Verwenden Sie Batchvorhersagen, wenn Sie nicht sofort eine Antwort benötigen und akkumulierte Daten in einer einzigen Anfrage verarbeiten möchten.
Modell lokal testen
Bevor Sie Vorhersagen abrufen, ist es sinnvoll, Ihr Modell während der Entwicklungs- und Testphase auf einem lokalen Endpunkt bereitzustellen. So können Sie sowohl schneller iterieren als auch Ihr Modell testen, ohne es auf einem Onlineendpunkt bereitstellen und ohne dass Vorhersagekosten anfallen. Die lokale Bereitstellung ist für lokale Entwicklung und Tests vorgesehen, nicht für die Produktionsbereitstellung.
Wenn Sie ein Modell lokal bereitstellen möchten, verwenden Sie das Vertex AI SDK für Python und stellen Sie ein LocalModel auf einem LocalEndpoint bereit.
Eine Demonstration finden Sie in diesem Notebook.
Auch wenn Ihr Client nicht in Python geschrieben ist, können Sie das Vertex AI SDK für Python verwenden, um den Container und den Server zu starten, sodass Sie Anfragen von Ihrem Client testen können.
Vorhersagen von benutzerdefinierten trainierten Modellen abrufen
[[["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-08-28 (UTC)."],[],[],null,["# Get inferences from a custom trained model\n\nAn inference is the output of a trained machine learning model. This page\nprovides an overview of the workflow for getting inferences from your models on\nVertex AI.\n\nVertex AI offers two methods for getting inferences:\n\n- **Online inferences** are synchronous requests made to a model that is deployed to an [`Endpoint`](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints). Therefore, before sending a request, you must first deploy the [`Model`](/vertex-ai/docs/reference/rest/v1/projects.locations.models) resource to an endpoint. This associates [compute resources](/vertex-ai/docs/predictions/configure-compute) with the model so that the model can serve online inferences with low latency. Use online inferences when you are making requests in response to application input or in situations that require timely inference.\n- are asynchronous requests made to a model that isn't deployed to an endpoint. You send the request (as a [`BatchPredictionJob`](/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs) resource) directly to the `Model` resource. Use batch inferences when you don't require an immediate response and want to process accumulated data by using a single request.\n\nTest your model locally\n-----------------------\n\nBefore getting inferences, it's useful to deploy your model to a local\nendpoint during the development and testing phase. This lets you both iterate\nmore quickly and test your model without deploying it to an online endpoint or\nincurring inference costs. Local deployment is intended for local development\nand testing, not for production deployments.\n\nTo deploy a model locally, use the Vertex AI SDK for Python and deploy a\n[`LocalModel`](/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.prediction.LocalModel)\nto a\n[`LocalEndpoint`](/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.prediction.LocalEndpoint).\nFor a demonstration, see [this\nnotebook](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/vertex_endpoints/find_ideal_machine_type/find_ideal_machine_type.ipynb).\n\nEven if your client is not written in Python, you can still use the\nVertex AI SDK for Python to launch the container and server so that you can test\nrequests from your client.\n\nGet inferences from custom trained models\n-----------------------------------------\n\nTo get inferences, you must first [import your\nmodel](/vertex-ai/docs/model-registry/import-model). After it's imported, it becomes a\n[`Model`](/vertex-ai/docs/reference/rest/v1/projects.locations.models) resource that is visible in\n[Vertex AI Model Registry](/vertex-ai/docs/model-registry/introduction).\n\nThen, read the following documentation to learn how to get inferences:\n\n- [Get batch inferences](/vertex-ai/docs/predictions/get-batch-predictions)\n\n Or\n- [Deploy model to endpoint](/vertex-ai/docs/general/deployment) and\n [get online inferences](/vertex-ai/docs/predictions/get-online-predictions).\n\nWhat's next\n-----------\n\n- Learn about [Compute resources for\n prediction](/vertex-ai/docs/predictions/configure-compute)."]]