Hello 画像データ: プロジェクトと環境の設定

Vertex AI SDK for Python を使用する場合は、クライアントを初期化するサービス アカウントに Vertex AI サービス エージェントroles/aiplatform.serviceAgent)IAM ロールが割り当てられていることを確認します。

Vertex AI を使用するように Google Cloud プロジェクトを設定します。次に、Cloud Storage バケットを作成して、AutoML 画像分類モデルのトレーニングに使用する画像ファイルをコピーします。

このチュートリアルには複数のページが含まれます。

  1. プロジェクトと環境を設定します。

  2. 画像分類データセットを作成して画像をインポートします

  3. AutoML 画像分類モデルをトレーニングします

  4. モデルのパフォーマンスを評価して分析します

  5. エンドポイントにモデルをデプロイして、予測を送信します

  6. プロジェクトをクリーンアップします

各ページは、前のページのチュートリアルの手順をすでに実施していることを前提としています。

始める前に

Vertex AI の機能を使用する前に、次の手順を実施してください。

  1. In the Google Cloud console, go to the project selector page.

    Go to project selector

  2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.
  3. Verify that billing is enabled for your Google Cloud project.

  4. Cloud Shell を開きます。Cloud Shell は Google Cloud のインタラクティブなシェル環境であり、ウェブブラウザからプロジェクトやリソースを管理できます。
  5. Cloud Shell に移動
  6. Cloud Shell で、現在のプロジェクトを Google Cloudプロジェクト ID に設定し、projectid シェル変数に格納します。
      gcloud config set project PROJECT_ID &&
      projectid=PROJECT_ID &&
      echo $projectid
    PROJECT_ID は、実際のプロジェクト ID に置き換えます。プロジェクト ID は Google Cloud コンソールで確認できます。詳細については、プロジェクト ID を確認するをご覧ください。
  7. 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 the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

  8. Make sure that you have the following role or roles on the project: roles/aiplatform.user, roles/storage.admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. 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.

    4. 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

    1. In the Google Cloud console, go to the IAM page.

      IAM に移動
    2. プロジェクトを選択します。
    3. [ アクセスを許可] をクリックします。
    4. [新しいプリンシパル] フィールドに、ユーザー ID を入力します。 これは通常、Google アカウントのメールアドレスです。

    5. [ロールを選択] リストでロールを選択します。
    6. 追加のロールを付与するには、 [別のロールを追加] をクリックして各ロールを追加します。
    7. [保存] をクリックします。
    Vertex AI ユーザー(roles/aiplatform.user)IAM ロールにより、Vertex AI 内のすべてのリソースを使用するためのアクセス権が付与されます。ストレージ管理者roles/storage.admin)のロールを使用すると、ドキュメントのトレーニング データセットを Cloud Storage に保存できます。

    次のステップ

    このチュートリアルの次のページの説明に従って、Google Cloud コンソールで画像分類データセットを作成し、一般公開の Cloud Storage バケットにホストされている画像をインポートする。