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.
-
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.
-
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 Berikan akses.
-
Di kolom Akun utama baru, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Pilih peran, 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.
-