Jika Anda berencana menggunakan Vertex AI SDK untuk Python, pastikan akun layanan
yang melakukan inisialisasi klien memiliki peran IAM
Vertex AI Service Agent
(roles/aiplatform.serviceAgent).
Anda perlu menyiapkan Google Cloud project untuk menggunakan Vertex AI. Kemudian, buat bucket Cloud Storage dan salin file gambar untuk digunakan dalam melatih model klasifikasi gambar AutoML.
Tutorial ini memiliki beberapa halaman:
Menyiapkan project dan lingkungan Anda.
Setiap halaman mengasumsikan bahwa Anda telah menjalankan petunjuk dari halaman tutorial sebelumnya.
Sebelum memulai
Selesaikan langkah-langkah berikut sebelum menggunakan fungsi Vertex AI.
-
In the Google Cloud console, go to the project selector page.
-
Select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
- Buka Cloud Shell. Cloud Shell adalah lingkungan shell interaktif untuk Google Cloud yang dapat Anda gunakan untuk mengelola project dan resource dari browser web. Buka Cloud Shell
- Di Cloud Shell, tetapkan project saat ini ke project ID Google Cloud
Anda dan simpan dalam variabel shell
projectid: Ganti PROJECT_ID dengan project ID Anda. Anda dapat menemukan project ID di konsol Google Cloud . Untuk mengetahui informasi selengkapnya, lihat Menemukan project ID.gcloud config set project PROJECT_ID && projectid=PROJECT_ID && echo $projectid
-
Enable the IAM, Compute Engine, Notebooks, Cloud Storage, and Vertex AI APIs:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.gcloud services enable iam.googleapis.com
compute.googleapis.com notebooks.googleapis.com storage.googleapis.com aiplatform.googleapis.com -
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/aiplatform.user, roles/storage.admingcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID: Your project ID.USER_IDENTIFIER: The identifier for your user account. For example,myemail@example.com.ROLE: The IAM role that you grant to your user account.
Peran IAM Vertex AI User (
roles/aiplatform.user) memberikan akses untuk menggunakan semua resource di Vertex AI. Peran Storage Admin (roles/storage.admin) yang Anda gunakan untuk menyimpan set data pelatihan dokumen di Cloud Storage.
Langkah berikutnya
Ikuti halaman berikutnya dalam tutorial ini untuk menggunakan konsolGoogle Cloud guna membuat set data klasifikasi gambar dan mengimpor gambar yang dihosting di bucket Cloud Storage publik.