[null,null,["最后更新时间 (UTC):2024-10-01。"],[[["\u003cp\u003eEarth Engine can connect to models hosted on Vertex AI using \u003ccode\u003eee.Model\u003c/code\u003e, enabling online prediction requests with Earth Engine data.\u003c/p\u003e\n"],["\u003cp\u003eSupported model types include TensorFlow, PyTorch, and AutoML, with inputs and outputs needing to be compatible with the specified interchange format.\u003c/p\u003e\n"],["\u003cp\u003eUsers need Vertex AI user role permissions for the Cloud Project to utilize the model with \u003ccode\u003eee.Model.fromVertexAi()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWhile \u003ccode\u003eus-central1\u003c/code\u003e region is recommended for optimal performance, other regions are supported for model deployment on Vertex AI endpoints.\u003c/p\u003e\n"],["\u003cp\u003eAssociated costs for Vertex AI, Cloud Storage, and Earth Engine should be considered, with detailed pricing information available on respective pages.\u003c/p\u003e\n"]]],[],null,["# Predictions from Hosted Models\n\nEarth Engine provides `ee.Model` as a connector to models hosted on\n[Vertex AI](https://cloud.google.com/vertex-ai/docs/start/introduction-unified-platform).\nEarth Engine will send image or table data as online prediction requests to a\ntrained model deployed on a Vertex AI endpoint. The model outputs are then\navailable as Earth Engine images or tables.\n\nTensorFlow Models\n-----------------\n\n[TensorFlow](https://www.tensorflow.org/) is an open source machine learning\n(ML) platform that supports advanced ML methods such as deep learning. The Earth\nEngine API provides methods for importing and or exporting imagery, training and\ntesting data in TFRecord format. See the\n[ML examples page](/earth-engine/guides/ml_examples) for demonstrations that use\nTensorFlow with data from Earth Engine. See the\n[TFRecord page](/earth-engine/guides/tfrecord) for details about how Earth\nEngine writes data to TFRecord files.\n\n`ee.Model`\n----------\n\nThe `ee.Model` package handles interaction with hosted machine learning models.\n\n### Hosted Models on Vertex AI\n\nA new `ee.Model` instance can be created with\n[ee.Model.fromVertexAi](/earth-engine/apidocs/ee-model-fromvertexai). This is an\n`ee.Model` object that packages Earth Engine data into tensors, forwards them as\npredict requests to [Vertex AI](https://cloud.google.com/vertex-ai) then\nreassembles the responses into Earth Engine.\n\nEarth Engine supports TensorFlow (e.g. a\n[SavedModel](https://www.tensorflow.org/guide/saved_model#save_and_restore_models)\nformat), PyTorch, and AutoML models. To prepare a model for hosting,\n[save it](https://cloud.google.com/vertex-ai/docs/training/exporting-model-artifacts),\n[import it to Vertex AI](https://cloud.google.com/vertex-ai/docs/model-registry/import-model),\nthen\n[deploy the model to an endpoint](https://cloud.google.com/vertex-ai/docs/predictions/get-predictions#deploy_a_model_to_an_endpoint).\n\n### Input Formats\n\nTo interact with Earth Engine, a hosted model's inputs and outputs need to be\ncompatible with a supported interchange format. The default is the TensorProto\ninterchange format, specifically serialized TensorProtos in base64\n([reference](https://cloud.google.com/vertex-ai/docs/general/base64)). This can\nbe done programmatically, as shown on the\n[ML examples page](/earth-engine/guides/ml_examples), after training and before\nsaving, or by loading, adding the input and output transformation, and\nre-saving. Other supported payload formats include\nJSON with `RAW_JSON` and multi-dimensional arrays with `ND_ARRAYS`. See our\n[payload format documentation](/earth-engine/guides/ee-vertex-payload-formats)\nfor more details.\n\n### Endpoint IAM Permissions\n\nTo use a model with `ee.Model.fromVertexAi()`, you must have sufficient\npermissions to use the model. Specifically, you (or anyone who uses the model)\nneeds at least the\n[Vertex AI user role](https://cloud.google.com/vertex-ai/docs/general/access-control#aiplatform.user)\nfor the Cloud Project where the model is hosted. You control permissions for\nyour Cloud Project using\n[Identify and Access Management (IAM)](https://cloud.google.com/iam) controls.\n\n### Regions\n\nWhen deploying your model to an endpoint, you will need to specify which region\nto deploy to. The `us-central1` region is recommended since it will likely\nperform best due to proximity to Earth Engine servers, but almost any region\nwill work. See the\n[Vertex AI location docs](https://cloud.google.com/vertex-ai/docs/general/locations)\nfor details about Vertex AI regions and what features each one supports.\n\nIf you are migrating from AI Platform, note that Vertex AI does not have a\nglobal endpoint, and `ee.Model.fromVertexAi()` does not have a `region`\nparameter.\n\n### Costs\n\n| **Warning:** These guides use billable components of Google Cloud.\n\nFor detailed information on costs, see each product's associated pricing page.\n\n- Vertex AI ([pricing](https://cloud.google.com/vertex-ai/pricing))\n- Cloud Storage ([pricing](https://cloud.google.com/storage/pricing))\n- Earth Engine ([pricing (commercial)](https://earthengine.google.com/commercial))\n\nYou can use the\n[Pricing Calculator](https://cloud.google.com/products/calculator) to generate a\ncost estimate based on your projected usage.\n\n### Further Reading\n\nFor more details on how to use a hosted model with Earth Engine see our\n[Image Prediction page](/earth-engine/guides/ee-vertex-image-predictions) for\nimage prediction, or our\n[Properties Prediction page](/earth-engine/guides/ee-vertex-property-predictions)"]]