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
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. 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.enable
permission. Learn how to grant roles. -
Make sure that you have the following role or roles on the project: roles/aiplatform.user, roles/storage.admin
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Buka IAM - Pilih project.
- Klik Grant access.
-
Di kolom New principals, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Select a role, pilih peran.
- Untuk memberikan peran tambahan, klik Tambahkan peran lain, lalu tambahkan setiap peran tambahan.
- Klik Simpan.
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.
-