تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
TensorFlow هي منصة مفتوحة المصدر لتكنولوجيا تعلُّم الآلة تسمح
باستخدام طرق تعلُّم الآلة المتقدّمة، مثل التعلّم العميق. توضّح هذه الصفحة ميزات محدّدة في TensorFlow
في Earth Engine. على الرغم من أنّ نماذج TensorFlow يتم تطويرها وتدريبها
خارج Earth Engine، توفّر واجهة برمجة التطبيقات Earth Engine API طرقًا لتصدير بيانات التدريب
والاختبار بتنسيق TFRecord واستيراد/تصدير الصور بتنسيق TFRecord. اطّلِع على
صفحة أمثلة TensorFlow للحصول على مزيد من المعلومات حول كيفية تطوير مسارات لاستخدام TensorFlow مع بيانات من Earth Engine. اطّلِع على
صفحة TFRecord للتعرّف على مزيد من المعلومات عن كيفية كتابة Earth Engine للبيانات في
ملفات TFRecord.
ee.Model
تعالج حزمة ee.Model التفاعل مع نماذج تعلُّم الآلة المستندة إلى TensorFlow.
التفاعل مع النماذج المستضافة على AI Platform
يمكن إنشاء مثيل ee.Model جديد باستخدام
ee.Model.fromAiPlatformPredictor(). هذا عنصر ee.Model
يحزم بيانات Earth Engine في مصفوفات، ويعيد توجيهها كطلبات توقّع إلى
Google AI Platform، ثم يعيد تلقائيًا
تجميع الردود في أنواع بيانات Earth Engine. يُرجى العِلم أنّه استنادًا إلى حجم
ومدى تعقيد النموذج وبيانات الإدخال، قد تحتاج إلى
تعديل
الحد الأدنى لحجم العقدة في نموذجك على "منصّة الذكاء الاصطناعي" لاستيعاب عددٍ كبيرٍ من
التوقّعات.
تتطلّب أداة Earth Engine أن تستخدم نماذج AI Platform تنسيق
SavedModel
في TensorFlow. لكي يتمكّن النموذج المستضاف من التفاعل مع Earth Engine، يجب أن تكون مدخلاته/مخرجاته
متوافقة مع تنسيق تبادل TensorProto، وبشكل خاص مع تنسيق ملف
TensorProto التسلسلي بترميز base64. لتسهيل ذلك، تتضمّن وحدة تحكّم سطر الأوامر في Earth Engine الأمر
model prepare الذي يلفّ
SavedModel حاليًا في العمليات المطلوبة لتحويل تنسيقات الإدخال/الإخراج.
لاستخدام نموذج مع ee.Model.fromAiPlatformPredictor()، يجب أن يكون لديك
أذونات كافية لاستخدام النموذج. على وجه التحديد، يجب أن يكون لديك (أو لدى أي مستخدم للنموذج)
على الأقل
دور "مستخدم نموذج محرّك تعلُّم الآلة". يمكنك فحص أذونات النماذج وضبطها من
صفحة النماذج في Cloud
Console.
المناطق
يجب استخدام نقاط نهاية إقليمية لنماذجك، مع تحديد المنطقة عند إنشاء النموذج،
وإنشاء الإصدار وفي ee.Model.fromAiPlatformPredictor(). يمكن استخدام أي منطقة، ولكن يُفضَّل استخدام us-central1. لا تحدِّد المَعلمة
REGIONS. إذا كنت بصدد إنشاء نموذج من
Cloud Console،
تأكَّد من وضع علامة في المربّع "إقليمي".
التكاليف
توقّعات الصور
استخدِم model.predictImage() لوضع توقّعات بشأن ee.Image
باستخدام نموذج مستضاف. نوع الإرجاع لـ predictImage() هو
ee.Image الذي يمكن إضافته إلى الخريطة، واستخدامه في عمليات حسابية أخرى،
وتصديره، وما إلى ذلك. ستعرِض Earth Engine تلقائيًا أشرطة الإدخال وتعدِّل
الإسقاط الناتج لتغييرات النطاق وإعادة التجميع حسب الحاجة. (اطّلِع على
مستند TFRecord للحصول على مزيد من المعلومات عن آلية عمل التجميع
في شرائح). يُرجى العِلم أنّ Earth Engine ستعيد توجيه مصفوفات 3D دائمًا إلى النموذج حتى عندما تكون
النطاقات متسلسلة (سيكون السمة الأخيرة هي 1).
ستتضمّن جميع النماذج التوليدية تقريبًا إسقاطًا ثابتًا للمدخلات (أي البيانات
التي تم تدريب النموذج عليها). في هذه الحالة، اضبط المَعلمة fixInputProj
على true في طلبك إلى ee.Model.fromAiPlatformPredictor().
عند عرض التوقّعات، يجب توخّي الحذر عند التصغير في نموذج يحتوي على تصوُّر ثابت
للإدخال. ويعود السبب في ذلك إلى السبب نفسه الموضّح
هنا. وعلى وجه التحديد، يمكن أن يؤدي التصغير إلى نطاق مكاني كبير إلى طلبات للحصول على
بيانات كثيرة جدًا، وقد يؤدي ذلك إلى إبطاء الأداء أو رفض الطلبات من قِبل "منصّة الذكاء الاصطناعي".
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis guide is deprecated and users should refer to the TensorFlow with Vertex AI guide for updated information.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine facilitates the use of TensorFlow for machine learning by providing methods for data export/import in TFRecord format and integration with AI Platform for model hosting.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eee.Model\u003c/code\u003e package enables interaction with TensorFlow models, specifically allowing predictions on Earth Engine images using models hosted on AI Platform.\u003c/p\u003e\n"],["\u003cp\u003eWhen using AI Platform models, ensure compatibility with TensorFlow's SavedModel format and configure necessary permissions for model access.\u003c/p\u003e\n"],["\u003cp\u003eBe mindful of potential costs associated with using billable components of Google Cloud, such as AI Platform and Cloud Storage.\u003c/p\u003e\n"]]],["This content outlines using TensorFlow models with Earth Engine, focusing on `ee.Model` for AI Platform interaction. Key actions include creating `ee.Model` instances with `ee.Model.fromAiPlatformPredictor()`, packaging Earth Engine data into tensors for AI Platform prediction requests, and reassembling responses. Models must use TensorFlow's SavedModel format, prepared using the Earth Engine CLI. Image predictions utilize `model.predictImage()`, returning an `ee.Image`. The document warns about costs associated with AI Platform and Cloud Storage and recommend using regional endpoints.\n"],null,["# Predictions using TensorFlow and Cloud AI Platform\n\n| **Deprecated!** This guide uses datasets that may be removed from the\n| Earth Engine catalog and/or methods that may be removed in future versions of the Earth\n| Engine API. See [](/earth-engine/guides/earth-engine/guides/tensorflow-vertex)instead.\n\n[TensorFlow](https://www.tensorflow.org/) is an open source ML platform that\nsupports advanced ML methods such as deep learning. This page describes TensorFlow\nspecific features in Earth Engine. Although TensorFlow models are developed and trained\noutside Earth Engine, the Earth Engine API provides methods for exporting training and\ntesting data in TFRecord format and importing/exporting imagery in TFRecord format. See\n[the TensorFlow examples page](/earth-engine/guides/tf_examples) for more information about how to\ndevelop pipelines for using TensorFlow with data from Earth Engine. See\n[the TFRecord page](/earth-engine/guides/tfrecord) to learn more about how Earth Engine writes data to\nTFRecord files.\n\n`ee.Model`\n----------\n\n\nThe `ee.Model` package handles interaction with TensorFlow backed machine\nlearning models.\n\n### Interacting with models hosted on AI Platform\n\n\nA new `ee.Model` instance can be created with\n`ee.Model.fromAiPlatformPredictor()`. This is an `ee.Model` object\nthat packages Earth Engine data into tensors, forwards them as predict requests to\n[Google AI Platform](https://cloud.google.com/ai-platform/) then automatically\nreassembles the responses into Earth Engine data types. Note that depending on the size\nand complexity of your model and its inputs, you may wish to\n[adjust\nthe minimum node size](https://cloud.google.com/ml-engine/docs/prediction-overview#node-allocation) of your AI Platform model to accommodate a high volume of\npredictions.\n\nEarth Engine requires AI Platform models to use TensorFlow's\n[SavedModel](https://www.tensorflow.org/guide/saved_model#save_and_restore_models)\nformat. Before a hosted model can interact with Earth Engine, its inputs/outputs need to\nbe compatible with the TensorProto interchange format, specifically serialized\nTensorProtos in base64. To make this easier, the Earth Engine CLI has the\n[`model prepare`](/earth-engine/guides/command_line#model) command that wraps an existing\nSavedModel in the required operations to convert input/output formats.\n\n\nTo use a model with `ee.Model.fromAiPlatformPredictor()`, you must have sufficient\npermissions to use the model. Specifically, you (or anyone who uses the model) needs at\nleast the [ML Engine Model User role](https://cloud.google.com/ai-platform/prediction/docs/access-control#model_user_role). You can inspect and set model permissions from the\n[models page of the Cloud\nConsole](https://console.cloud.google.com/ai-platform/models).\n\n### Regions\n\n\nYou should use regional endpoints for your models, specifying the region at model creation,\nversion creation and in `ee.Model.fromAiPlatformPredictor()`. Any region will\nwork (don't use global), but `us-central1` is preferred. Don't specify the\n`REGIONS` parameter. If you are are creating a model from the\n[Cloud Console](https://console.cloud.google.com/ai-platform/models),\nensure the regional box is checked.\n\nCosts\n-----\n\n| **Warning!** These guides use billable components of Google Cloud including:\n|\n| - AI Platform Training ([pricing](https://cloud.google.com/ai-platform/training/pricing))\n| - AI Platform Prediction ([pricing](https://cloud.google.com/ai-platform/prediction/pricing))\n| - Cloud Storage ([pricing](https://cloud.google.com/storage/pricing))\n|\n| You can use the\n| [Pricing Calculator](https://cloud.google.com/products/calculator) to generate\n| a cost estimate based on your projected usage.\n\n### Image Predictions\n\n\nUse `model.predictImage()` to make predictions on an `ee.Image`\nusing a hosted model. The return type of `predictImage()` is an\n`ee.Image` which can be added to the map, used in other computations,\nexported, etc. Earth Engine will automatically tile the input bands and adjust\nthe output projection for scale changes and overtiling as needed. (See\n[the TFRecord doc](/earth-engine/guides/tfrecord#exporting-images) for more information on how tiling\nworks). Note that Earth Engine will always forward 3D tensors to your model even when\nbands are scalar (the last dimension will be 1).\n\n\nNearly all convolutional models will have a fixed input projection (that of the data\non which the model was trained). In this case, set the `fixInputProj` parameter\nto **true** in your call to `ee.Model.fromAiPlatformPredictor()`.\nWhen visualizing predictions, use caution when zooming out on a model that has a fixed\ninput projection. This is for the same reason as [described\nhere](/earth-engine/guides/projections#reprojecting). Specifically, zooming to a large spatial scope can result in requests for too\nmuch data and may manifest as slowdowns or rejections by AI Platform."]]