Vertex AI API를 사용한 AutoML Edge 모델 학습

Google Cloud 콘솔에서 직접 또는 APIVertex AI 클라이언트 라이브러리 중 하나를 사용하여 프로그래매틱 방식으로 학습 파이프라인을 만들어 AutoML 모델을 만듭니다.

이 모델은 콘솔 또는 API를 사용하여 제공되는 준비된 데이터 세트로 생성됩니다. Vertex AI API는 데이터 세트의 항목을 사용하여 모델을 학습시키고 테스트하고 모델 성능을 평가합니다. 평가 결과를 검토하고 필요에 따라 학습 데이터 세트를 조정하며 향상된 데이터 세트를 사용하여 새 학습 파이프라인을 만드세요.

모델 학습을 완료하는 데 몇 시간 정도 걸릴 수 있습니다. Vertex AI API를 사용하면 학습 상태를 가져올 수 있습니다.

AutoML Edge 학습 파이프라인 만들기

대표성이 있는 학습 항목 세트가 포함된 데이터 세트가 있으면 AutoML Edge 학습 파이프라인을 만들 준비가 된 것입니다.

데이터 유형을 선택하세요.

이미지

아래에서 목표에 대한 탭을 선택합니다.

분류

학습 시에는 특정 사용 사례에 따라 원하는 AutoML Edge 모델 유형을 선택할 수 있습니다.

  • 짧은 지연 시간(MOBILE_TF_LOW_LATENCY_1)
  • 범용 용도(MOBILE_TF_VERSATILE_1)
  • 예측 품질 개선(MOBILE_TF_HIGH_ACCURACY_1)

아래에서 언어 또는 환경에 대한 탭을 선택하세요.

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • LOCATION: 데이터 세트가 있고 모델이 생성된 리전입니다. 예를 들면 us-central1입니다.
  • PROJECT: 프로젝트 ID
  • TRAININGPIPELINE_DISPLAYNAME: 필수. trainingPipeline의 표시 이름입니다.
  • DATASET_ID: 학습에 사용할 데이터 세트의 ID 번호입니다.
  • fractionSplit: 선택사항. 가능한 여러 ML 중 하나가 데이터에 분할 옵션을 사용합니다. fractionSplit의 경우 값은 합계가 1이어야 합니다. 예를 들면 다음과 같습니다.
    • {"trainingFraction": "0.7","validationFraction": "0.15","testFraction": "0.15"}
  • MODEL_DISPLAYNAME*: TrainingPipeline에서 업로드(생성)한 모델의 표시 이름입니다.
  • MODEL_DESCRIPTION*: 모델에 대한 설명입니다.
  • modelToUpload.labels*: 모델을 구성할 모든 키-값 쌍 세트입니다. 예를 들면 다음과 같습니다.
    • "env": "prod"
    • "tier": "backend"
  • EDGE_MODELTYPE: 학습시킬 Edge 모델의 유형입니다. 옵션은 다음과 같습니다.
    • MOBILE_TF_LOW_LATENCY_1
    • MOBILE_TF_VERSATILE_1
    • MOBILE_TF_HIGH_ACCURACY_1
  • NODE_HOUR_BUDGET: 실제 학습 비용은 이 값보다 작거나 같습니다. Edge 모델의 경우 예산은 1,000~100,000밀리 노드 시간이어야 합니다(1,000, 100,000 포함).
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines

JSON 요청 본문:

{
  "displayName": "TRAININGPIPELINE_DISPLAYNAME",
  "inputDataConfig": {
    "datasetId": "DATASET_ID",
    "fractionSplit": {
      "trainingFraction": "DECIMAL",
      "validationFraction": "DECIMAL",
      "testFraction": "DECIMAL"
    }
  },
  "modelToUpload": {
    "displayName": "MODEL_DISPLAYNAME",
    "description": "MODEL_DESCRIPTION",
    "labels": {
      "KEY": "VALUE"
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_image_classification_1.0.0.yaml",
  "trainingTaskInputs": {
    "multiLabel": "false",
    "modelType": ["EDGE_MODELTYPE"],
    "budgetMilliNodeHours": NODE_HOUR_BUDGET
  }
}

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines"

PowerShell

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines" | Select-Object -Expand Content

응답에는 사양 및 TRAININGPIPELINE_ID에 대한 정보가 포함됩니다.

TRAININGPIPELINE_ID를 사용하여 trainingPipeline 작업의 상태를 가져올 수 있습니다.

분류

학습 시에는 특정 사용 사례에 따라 원하는 AutoML Edge 모델 유형을 선택할 수 있습니다.

  • 짧은 지연 시간(MOBILE_TF_LOW_LATENCY_1)
  • 범용 용도(MOBILE_TF_VERSATILE_1)
  • 예측 품질 개선(MOBILE_TF_HIGH_ACCURACY_1)

아래에서 언어 또는 환경에 대한 탭을 선택하세요.

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • LOCATION: 데이터 세트가 있고 모델이 생성된 리전입니다. 예를 들면 us-central1입니다.
  • PROJECT: 프로젝트 ID
  • TRAININGPIPELINE_DISPLAYNAME: 필수. trainingPipeline의 표시 이름입니다.
  • DATASET_ID: 학습에 사용할 데이터 세트의 ID 번호입니다.
  • fractionSplit: 선택사항. 가능한 여러 ML 중 하나가 데이터에 분할 옵션을 사용합니다. fractionSplit의 경우 값은 합계가 1이어야 합니다. 예를 들면 다음과 같습니다.
    • {"trainingFraction": "0.7","validationFraction": "0.15","testFraction": "0.15"}
  • MODEL_DISPLAYNAME*: TrainingPipeline에서 업로드(생성)한 모델의 표시 이름입니다.
  • MODEL_DESCRIPTION*: 모델에 대한 설명입니다.
  • modelToUpload.labels*: 모델을 구성할 모든 키-값 쌍 세트입니다. 예를 들면 다음과 같습니다.
    • "env": "prod"
    • "tier": "backend"
  • EDGE_MODELTYPE: 학습시킬 Edge 모델의 유형입니다. 옵션은 다음과 같습니다.
    • MOBILE_TF_LOW_LATENCY_1
    • MOBILE_TF_VERSATILE_1
    • MOBILE_TF_HIGH_ACCURACY_1
  • NODE_HOUR_BUDGET: 실제 학습 비용은 이 값보다 작거나 같습니다. Edge 모델의 경우 예산은 1,000~100,000밀리 노드 시간이어야 합니다(1,000, 100,000 포함).
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines

JSON 요청 본문:

{
  "displayName": "TRAININGPIPELINE_DISPLAYNAME",
  "inputDataConfig": {
    "datasetId": "DATASET_ID",
    "fractionSplit": {
      "trainingFraction": "DECIMAL",
      "validationFraction": "DECIMAL",
      "testFraction": "DECIMAL"
    }
  },
  "modelToUpload": {
    "displayName": "MODEL_DISPLAYNAME",
    "description": "MODEL_DESCRIPTION",
    "labels": {
      "KEY": "VALUE"
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_image_classification_1.0.0.yaml",
  "trainingTaskInputs": {
    "multiLabel": "true",
    "modelType": ["EDGE_MODELTYPE"],
    "budgetMilliNodeHours": NODE_HOUR_BUDGET
  }
}

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines"

PowerShell

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines" | Select-Object -Expand Content

응답에는 사양 및 TRAININGPIPELINE_ID에 대한 정보가 포함됩니다.

TRAININGPIPELINE_ID를 사용하여 trainingPipeline 작업의 상태를 가져올 수 있습니다.

객체 감지

학습 시에는 특정 사용 사례에 따라 원하는 AutoML Edge 모델 유형을 선택할 수 있습니다.

  • 짧은 지연 시간(MOBILE_TF_LOW_LATENCY_1)
  • 범용 용도(MOBILE_TF_VERSATILE_1)
  • 예측 품질 개선(MOBILE_TF_HIGH_ACCURACY_1)

아래에서 언어 또는 환경에 대한 탭을 선택하세요.

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • LOCATION: 데이터 세트가 있고 모델이 생성된 리전입니다. 예를 들면 us-central1입니다.
  • PROJECT: 프로젝트 ID
  • TRAININGPIPELINE_DISPLAYNAME: 필수. trainingPipeline의 표시 이름입니다.
  • DATASET_ID: 학습에 사용할 데이터 세트의 ID 번호입니다.
  • fractionSplit: 선택사항. 가능한 여러 ML 중 하나가 데이터에 분할 옵션을 사용합니다. fractionSplit의 경우 값은 합계가 1이어야 합니다. 예를 들면 다음과 같습니다.
    • {"trainingFraction": "0.7","validationFraction": "0.15","testFraction": "0.15"}
  • MODEL_DISPLAYNAME*: TrainingPipeline에서 업로드(생성)한 모델의 표시 이름입니다.
  • MODEL_DESCRIPTION*: 모델에 대한 설명입니다.
  • modelToUpload.labels*: 모델을 구성할 모든 키-값 쌍 세트입니다. 예를 들면 다음과 같습니다.
    • "env": "prod"
    • "tier": "backend"
  • EDGE_MODELTYPE: 학습시킬 Edge 모델의 유형입니다. 옵션은 다음과 같습니다.
    • MOBILE_TF_LOW_LATENCY_1
    • MOBILE_TF_VERSATILE_1
    • MOBILE_TF_HIGH_ACCURACY_1
  • NODE_HOUR_BUDGET: 실제 학습 비용은 이 값보다 작거나 같습니다. Cloud 모델의 경우 예산은 20,000~900,000밀리 노드 시간이어야 합니다(20,000, 900,000 포함). 기본값은 실제 경과 시간으로 1일을 나타내는 216,000이며, 9개의 노드가 사용되었음을 의미합니다.
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines

JSON 요청 본문:

{
  "displayName": "TRAININGPIPELINE_DISPLAYNAME",
  "inputDataConfig": {
    "datasetId": "DATASET_ID",
    "fractionSplit": {
      "trainingFraction": "DECIMAL",
      "validationFraction": "DECIMAL",
      "testFraction": "DECIMAL"
    }
  },
  "modelToUpload": {
    "displayName": "MODEL_DISPLAYNAME",
    "description": "MODEL_DESCRIPTION",
    "labels": {
      "KEY": "VALUE"
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_image_object_detection_1.0.0.yaml",
  "trainingTaskInputs": {
    "modelType": ["EDGE_MODELTYPE"],
    "budgetMilliNodeHours": NODE_HOUR_BUDGET
  }
}

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines"

PowerShell

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines" | Select-Object -Expand Content

응답에는 사양 및 TRAININGPIPELINE_ID에 대한 정보가 포함됩니다.

TRAININGPIPELINE_ID를 사용하여 trainingPipeline 작업의 상태를 가져올 수 있습니다.

동영상

아래에서 목표에 대한 탭을 선택합니다.

동작 인식

학습 시 다음 AutoML Edge 유형을 선택합니다.

  • MOBILE_VERSATILE_1: 범용 용도

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • PROJECT: 프로젝트 ID
  • LOCATION: 데이터 세트가 있고 모델이 생성된 리전입니다. 예를 들면 us-central1입니다.
  • TRAINING_PIPELINE_DISPLAY_NAME: 필수. TrainingPipeline의 표시 이름입니다.
  • DATASET_ID: 학습 데이터 세트의 ID입니다.
  • TRAINING_FRACTION, TEST_FRACTION: fractionSplit 객체는 선택사항이며 데이터 분할을 제어하기 위해 사용됩니다. 데이터 분할 제어에 대한 자세한 내용은 AutoML 모델의 데이터 분할 정보를 참조하세요. 예를 들면 다음과 같습니다.
    • {"trainingFraction": "0.8","validationFraction": "0","testFraction": "0.2"}
  • MODEL_DISPLAY_NAME: 학습된 모델의 표시 이름입니다.
  • MODEL_DESCRIPTION: 모델에 대한 설명입니다.
  • MODEL_LABELS: 모델을 구성할 모든 키-값 쌍 세트입니다. 예를 들면 다음과 같습니다.
    • "env": "prod"
    • "tier": "backend"
  • EDGE_MODEL_TYPE:
    • MOBILE_VERSATILE_1: 범용 용도
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

POST https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines

JSON 요청 본문:

{
  "displayName": "TRAINING_PIPELINE_DISPLAY_NAME",
  "inputDataConfig": {
    "datasetId": "DATASET_ID",
    "fractionSplit": {
      "trainingFraction": "TRAINING_FRACTION",
      "validationFraction": "0",
      "testFraction": "TEST_FRACTION"
    }
  },
  "modelToUpload": {
    "displayName": "MODEL_DISPLAY_NAME",
    "description": "MODEL_DESCRIPTION",
    "labels": {
      "KEY": "VALUE"
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_video_action_recognition_1.0.0.yaml",
  "trainingTaskInputs": {
    "modelType": ["EDGE_MODEL_TYPE"],
  }
}

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines"

PowerShell

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines" | Select-Object -Expand Content

응답에는 사양 및 TRAININGPIPELINE_ID에 대한 정보가 포함됩니다.

완료 시간을 확인하기 위해 trainingPipeline 진행률의 상태를 가져올 수 있습니다.

분류

학습 시 다음 AutoML Edge 유형을 선택합니다.

  • MOBILE_VERSATILE_1: 범용 용도

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • PROJECT: 프로젝트 ID
  • LOCATION: 데이터 세트가 있고 모델이 생성된 리전입니다. 예를 들면 us-central1입니다.
  • TRAINING_PIPELINE_DISPLAY_NAME: 필수. TrainingPipeline의 표시 이름입니다.
  • DATASET_ID: 학습 데이터 세트의 ID입니다.
  • TRAINING_FRACTION, TEST_FRACTION: fractionSplit 객체는 선택사항이며 데이터 분할을 제어하기 위해 사용됩니다. 데이터 분할 제어에 대한 자세한 내용은 AutoML 모델의 데이터 분할 정보를 참조하세요. 예를 들면 다음과 같습니다.
    • {"trainingFraction": "0.8","validationFraction": "0","testFraction": "0.2"}
  • MODEL_DISPLAY_NAME: 학습된 모델의 표시 이름입니다.
  • MODEL_DESCRIPTION: 모델에 대한 설명입니다.
  • MODEL_LABELS: 모델을 구성할 모든 키-값 쌍 세트입니다. 예를 들면 다음과 같습니다.
    • "env": "prod"
    • "tier": "backend"
  • EDGE_MODEL_TYPE:
    • MOBILE_VERSATILE_1: 범용 용도
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

POST https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines

JSON 요청 본문:

{
  "displayName": "TRAINING_PIPELINE_DISPLAY_NAME",
  "inputDataConfig": {
    "datasetId": "DATASET_ID",
    "fractionSplit": {
      "trainingFraction": "TRAINING_FRACTION",
      "validationFraction": "0",
      "testFraction": "TEST_FRACTION"
    }
  },
  "modelToUpload": {
    "displayName": "MODEL_DISPLAY_NAME",
    "description": "MODEL_DESCRIPTION",
    "labels": {
      "KEY": "VALUE"
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_video_classification_1.0.0.yaml",
  "trainingTaskInputs": {
    "modelType": ["EDGE_MODEL_TYPE"],
  }
}

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines"

PowerShell

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines" | Select-Object -Expand Content

응답에는 사양 및 TRAININGPIPELINE_ID에 대한 정보가 포함됩니다.

완료 시간을 확인하기 위해 trainingPipeline 진행률의 상태를 가져올 수 있습니다.

객체 추적

학습 시 AutoML Edge 유형을 선택합니다.

  • MOBILE_VERSATILE_1: 범용 용도
  • MOBILE_CORAL_VERSATILE_1: Google Coral의 예측 품질 개선
  • MOBILE_CORAL_LOW_LATENCY_1: Google Cordo의 지연 시간 감소
  • MOBILE_JETSON_VERSATILE_1: NVIDIA Jetson의 예측 품질 개선
  • MOBILE_JETSON_LOW_LATENCY_1: NVIDIA Jetson의 지연 시간 감소

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • PROJECT: 프로젝트 ID
  • LOCATION: 데이터 세트가 있고 모델이 생성된 리전입니다. 예를 들면 us-central1입니다.
  • TRAINING_PIPELINE_DISPLAY_NAME: 필수. TrainingPipeline의 표시 이름입니다.
  • DATASET_ID: 학습 데이터 세트의 ID입니다.
  • TRAINING_FRACTION, TEST_FRACTION: fractionSplit 객체는 선택사항이며 데이터 분할을 제어하기 위해 사용됩니다. 데이터 분할 제어에 대한 자세한 내용은 AutoML 모델의 데이터 분할 정보를 참조하세요. 예를 들면 다음과 같습니다.
    • {"trainingFraction": "0.8","validationFraction": "0","testFraction": "0.2"}
  • MODEL_DISPLAY_NAME: 학습된 모델의 표시 이름입니다.
  • MODEL_DESCRIPTION: 모델에 대한 설명입니다.
  • MODEL_LABELS: 모델을 구성할 모든 키-값 쌍 세트입니다. 예를 들면 다음과 같습니다.
    • "env": "prod"
    • "tier": "backend"
  • EDGE_MODEL_TYPE: 다음 유형 중 하나입니다.
    • MOBILE_VERSATILE_1: 범용 용도
    • MOBILE_CORAL_VERSATILE_1: Google Coral의 예측 품질 개선
    • MOBILE_CORAL_LOW_LATENCY_1: Google Cordo의 지연 시간 감소
    • MOBILE_JETSON_VERSATILE_1: NVIDIA Jetson의 예측 품질 개선
    • MOBILE_JETSON_LOW_LATENCY_1: NVIDIA Jetson의 지연 시간 감소
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

POST https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines

JSON 요청 본문:

{
  "displayName": "TRAINING_PIPELINE_DISPLAY_NAME",
  "inputDataConfig": {
    "datasetId": "DATASET_ID",
    "fractionSplit": {
      "trainingFraction": "TRAINING_FRACTION",
      "validationFraction": "0",
      "testFraction": "TEST_FRACTION"
    }
  },
  "modelToUpload": {
    "displayName": "MODEL_DISPLAY_NAME",
    "description": "MODEL_DESCRIPTION",
    "labels": {
      "KEY": "VALUE"
    }
  },
  "trainingTaskDefinition": "gs://google-cloud-aiplatform/schema/trainingjob/definition/automl_video_object_tracking_1.0.0.yaml",
  "trainingTaskInputs": {
    "modelType": ["EDGE_MODEL_TYPE"],
  }
}

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines"

PowerShell

요청 본문을 request.json 파일에 저장하고 다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/beta1/projects/PROJECT/locations/LOCATION/trainingPipelines" | Select-Object -Expand Content

응답에는 사양 및 TRAININGPIPELINE_ID에 대한 정보가 포함됩니다.

완료 시간을 확인하기 위해 trainingPipeline 진행률의 상태를 가져올 수 있습니다.

trainingPipeline 상태 가져오기

다음 코드를 사용하여 trainingPipeline 만들기 상태를 프로그래매틱 방식으로 가져합니다.

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • LOCATION: TrainingPipeline이 있는 리전입니다.
  • PROJECT: 프로젝트 ID
  • TRAININGPIPELINE_ID: 특정 TrainingPipeline의 ID입니다.
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

GET https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines/TRAININGPIPELINE_ID

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

다음 명령어를 실행합니다.

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines/TRAININGPIPELINE_ID"

PowerShell

다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/trainingPipelines/TRAININGPIPELINE_ID" | Select-Object -Expand Content

"state" 필드는 작업의 현재 상태를 보여줍니다. 완료된 trainingPipeline은 다음을 보여줍니다.

TrainingPipeline 만들기 작업이 완료되면 다음과 유사한 출력이 표시됩니다.

Java

이 샘플을 사용해 보기 전에 Vertex AI 빠른 시작: 클라이언트 라이브러리 사용Java 설정 안내를 따르세요. 자세한 내용은 Vertex AI Java API 참고 문서를 참조하세요.

Vertex AI에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.


import com.google.cloud.aiplatform.v1.DeployedModelRef;
import com.google.cloud.aiplatform.v1.EnvVar;
import com.google.cloud.aiplatform.v1.FilterSplit;
import com.google.cloud.aiplatform.v1.FractionSplit;
import com.google.cloud.aiplatform.v1.InputDataConfig;
import com.google.cloud.aiplatform.v1.Model;
import com.google.cloud.aiplatform.v1.ModelContainerSpec;
import com.google.cloud.aiplatform.v1.PipelineServiceClient;
import com.google.cloud.aiplatform.v1.PipelineServiceSettings;
import com.google.cloud.aiplatform.v1.Port;
import com.google.cloud.aiplatform.v1.PredefinedSplit;
import com.google.cloud.aiplatform.v1.PredictSchemata;
import com.google.cloud.aiplatform.v1.TimestampSplit;
import com.google.cloud.aiplatform.v1.TrainingPipeline;
import com.google.cloud.aiplatform.v1.TrainingPipelineName;
import com.google.rpc.Status;
import java.io.IOException;

public class GetTrainingPipelineSample {
  public static void main(String[] args) throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String project = "YOUR_PROJECT_ID";
    String trainingPipelineId = "YOUR_TRAINING_PIPELINE_ID";
    getTrainingPipeline(project, trainingPipelineId);
  }

  static void getTrainingPipeline(String project, String trainingPipelineId) throws IOException {
    PipelineServiceSettings pipelineServiceSettings =
        PipelineServiceSettings.newBuilder()
            .setEndpoint("us-central1-aiplatform.googleapis.com:443")
            .build();

    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (PipelineServiceClient pipelineServiceClient =
        PipelineServiceClient.create(pipelineServiceSettings)) {
      String location = "us-central1";
      TrainingPipelineName trainingPipelineName =
          TrainingPipelineName.of(project, location, trainingPipelineId);

      TrainingPipeline trainingPipelineResponse =
          pipelineServiceClient.getTrainingPipeline(trainingPipelineName);

      System.out.println("Get Training Pipeline Response");
      System.out.format("\tName: %s\n", trainingPipelineResponse.getName());
      System.out.format("\tDisplay Name: %s\n", trainingPipelineResponse.getDisplayName());
      System.out.format(
          "\tTraining Task Definition: %s\n", trainingPipelineResponse.getTrainingTaskDefinition());
      System.out.format(
          "\tTraining Task Inputs: %s\n", trainingPipelineResponse.getTrainingTaskInputs());
      System.out.format(
          "\tTraining Task Metadata: %s\n", trainingPipelineResponse.getTrainingTaskMetadata());
      System.out.format("\tState: %s\n", trainingPipelineResponse.getState());
      System.out.format("\tCreate Time: %s\n", trainingPipelineResponse.getCreateTime());
      System.out.format("\tStart Time: %s\n", trainingPipelineResponse.getStartTime());
      System.out.format("\tEnd Time: %s\n", trainingPipelineResponse.getEndTime());
      System.out.format("\tUpdate Time: %s\n", trainingPipelineResponse.getUpdateTime());
      System.out.format("\tLabels: %s\n", trainingPipelineResponse.getLabelsMap());
      InputDataConfig inputDataConfig = trainingPipelineResponse.getInputDataConfig();

      System.out.println("\tInput Data Config");
      System.out.format("\t\tDataset Id: %s\n", inputDataConfig.getDatasetId());
      System.out.format("\t\tAnnotations Filter: %s\n", inputDataConfig.getAnnotationsFilter());
      FractionSplit fractionSplit = inputDataConfig.getFractionSplit();

      System.out.println("\t\tFraction Split");
      System.out.format("\t\t\tTraining Fraction: %s\n", fractionSplit.getTrainingFraction());
      System.out.format("\t\t\tValidation Fraction: %s\n", fractionSplit.getValidationFraction());
      System.out.format("\t\t\tTest Fraction: %s\n", fractionSplit.getTestFraction());
      FilterSplit filterSplit = inputDataConfig.getFilterSplit();

      System.out.println("\t\tFilter Split");
      System.out.format("\t\t\tTraining Filter: %s\n", filterSplit.getTrainingFilter());
      System.out.format("\t\t\tValidation Filter: %s\n", filterSplit.getValidationFilter());
      System.out.format("\t\t\tTest Filter: %s\n", filterSplit.getTestFilter());
      PredefinedSplit predefinedSplit = inputDataConfig.getPredefinedSplit();

      System.out.println("\t\tPredefined Split");
      System.out.format("\t\t\tKey: %s\n", predefinedSplit.getKey());
      TimestampSplit timestampSplit = inputDataConfig.getTimestampSplit();

      System.out.println("\t\tTimestamp Split");
      System.out.format("\t\t\tTraining Fraction: %s\n", timestampSplit.getTrainingFraction());
      System.out.format("\t\t\tTest Fraction: %s\n", timestampSplit.getTestFraction());
      System.out.format("\t\t\tValidation Fraction: %s\n", timestampSplit.getValidationFraction());
      System.out.format("\t\t\tKey: %s\n", timestampSplit.getKey());
      Model modelResponse = trainingPipelineResponse.getModelToUpload();

      System.out.println("\t\tModel to upload");
      System.out.format("\t\tName: %s\n", modelResponse.getName());
      System.out.format("\t\tDisplay Name: %s\n", modelResponse.getDisplayName());
      System.out.format("\t\tDescription: %s\n", modelResponse.getDescription());
      System.out.format("\t\tMetadata Schema Uri: %s\n", modelResponse.getMetadataSchemaUri());
      System.out.format("\t\tMeta Data: %s\n", modelResponse.getMetadata());
      System.out.format("\t\tTraining Pipeline: %s\n", modelResponse.getTrainingPipeline());
      System.out.format("\t\tArtifact Uri: %s\n", modelResponse.getArtifactUri());
      System.out.format(
          "\t\tSupported Deployment Resources Types: %s\n",
          modelResponse.getSupportedDeploymentResourcesTypesList().toString());
      System.out.format(
          "\t\tSupported Input Storage Formats: %s\n",
          modelResponse.getSupportedInputStorageFormatsList().toString());
      System.out.format(
          "\t\tSupported Output Storage Formats: %s\n",
          modelResponse.getSupportedOutputStorageFormatsList().toString());
      System.out.format("\t\tCreate Time: %s\n", modelResponse.getCreateTime());
      System.out.format("\t\tUpdate Time: %s\n", modelResponse.getUpdateTime());
      System.out.format("\t\tLabels: %s\n", modelResponse.getLabelsMap());
      PredictSchemata predictSchemata = modelResponse.getPredictSchemata();

      System.out.println("\tPredict Schemata");
      System.out.format("\t\tInstance Schema Uri: %s\n", predictSchemata.getInstanceSchemaUri());
      System.out.format(
          "\t\tParameters Schema Uri: %s\n", predictSchemata.getParametersSchemaUri());
      System.out.format(
          "\t\tPrediction Schema Uri: %s\n", predictSchemata.getPredictionSchemaUri());

      for (Model.ExportFormat supportedExportFormat :
          modelResponse.getSupportedExportFormatsList()) {
        System.out.println("\tSupported Export Format");
        System.out.format("\t\tId: %s\n", supportedExportFormat.getId());
      }
      ModelContainerSpec containerSpec = modelResponse.getContainerSpec();

      System.out.println("\tContainer Spec");
      System.out.format("\t\tImage Uri: %s\n", containerSpec.getImageUri());
      System.out.format("\t\tCommand: %s\n", containerSpec.getCommandList());
      System.out.format("\t\tArgs: %s\n", containerSpec.getArgsList());
      System.out.format("\t\tPredict Route: %s\n", containerSpec.getPredictRoute());
      System.out.format("\t\tHealth Route: %s\n", containerSpec.getHealthRoute());

      for (EnvVar envVar : containerSpec.getEnvList()) {
        System.out.println("\t\tEnv");
        System.out.format("\t\t\tName: %s\n", envVar.getName());
        System.out.format("\t\t\tValue: %s\n", envVar.getValue());
      }

      for (Port port : containerSpec.getPortsList()) {
        System.out.println("\t\tPort");
        System.out.format("\t\t\tContainer Port: %s\n", port.getContainerPort());
      }

      for (DeployedModelRef deployedModelRef : modelResponse.getDeployedModelsList()) {
        System.out.println("\tDeployed Model");
        System.out.format("\t\tEndpoint: %s\n", deployedModelRef.getEndpoint());
        System.out.format("\t\tDeployed Model Id: %s\n", deployedModelRef.getDeployedModelId());
      }

      Status status = trainingPipelineResponse.getError();
      System.out.println("\tError");
      System.out.format("\t\tCode: %s\n", status.getCode());
      System.out.format("\t\tMessage: %s\n", status.getMessage());
    }
  }
}

Python

Python을 설치하거나 업데이트하는 방법은 Python용 Vertex AI SDK 설치를 참조하세요. 자세한 내용은 Python API 참고 문서를 참조하세요.

from google.cloud import aiplatform

def get_training_pipeline_sample(
    project: str,
    training_pipeline_id: str,
    location: str = "us-central1",
    api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
    # The AI Platform services require regional API endpoints.
    client_options = {"api_endpoint": api_endpoint}
    # Initialize client that will be used to create and send requests.
    # This client only needs to be created once, and can be reused for multiple requests.
    client = aiplatform.gapic.PipelineServiceClient(client_options=client_options)
    name = client.training_pipeline_path(
        project=project, location=location, training_pipeline=training_pipeline_id
    )
    response = client.get_training_pipeline(name=name)
    print("response:", response)

모델 정보 가져오기

trainingPipeline 만들기가 완료된 다음에는 모델의 표시 이름을 사용하여 보다 자세한 모델 정보를 가져올 수 있습니다.

REST

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • LOCATION: 모델이 있는 리전입니다. 예: us-central1
  • PROJECT: 프로젝트 ID
  • MODEL_DISPLAYNAME: trainingPipeline 작업을 만들 때 지정한 모델의 표시 이름입니다.
  • PROJECT_NUMBER: 프로젝트의 자동으로 생성된 프로젝트 번호

HTTP 메서드 및 URL:

GET https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/models?filter=display_name=MODEL_DISPLAYNAME

요청을 보내려면 다음 옵션 중 하나를 선택합니다.

curl

다음 명령어를 실행합니다.

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/models?filter=display_name=MODEL_DISPLAYNAME "

PowerShell

다음 명령어를 실행합니다.

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/models?filter=display_name=MODEL_DISPLAYNAME " | Select-Object -Expand Content

학습된 AutoML Edge 모델에 대해 다음과 비슷한 출력이 표시됩니다. 다음 샘플 출력은 이미지 AutoML Edge 모델의 출력입니다.

Java

이 샘플을 사용해 보기 전에 Vertex AI 빠른 시작: 클라이언트 라이브러리 사용Java 설정 안내를 따르세요. 자세한 내용은 Vertex AI Java API 참고 문서를 참조하세요.

Vertex AI에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.


import com.google.cloud.aiplatform.v1.DeployedModelRef;
import com.google.cloud.aiplatform.v1.EnvVar;
import com.google.cloud.aiplatform.v1.Model;
import com.google.cloud.aiplatform.v1.Model.ExportFormat;
import com.google.cloud.aiplatform.v1.ModelContainerSpec;
import com.google.cloud.aiplatform.v1.ModelName;
import com.google.cloud.aiplatform.v1.ModelServiceClient;
import com.google.cloud.aiplatform.v1.ModelServiceSettings;
import com.google.cloud.aiplatform.v1.Port;
import com.google.cloud.aiplatform.v1.PredictSchemata;
import java.io.IOException;

public class GetModelSample {

  public static void main(String[] args) throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String project = "YOUR_PROJECT_ID";
    String modelId = "YOUR_MODEL_ID";
    getModelSample(project, modelId);
  }

  static void getModelSample(String project, String modelId) throws IOException {
    ModelServiceSettings modelServiceSettings =
        ModelServiceSettings.newBuilder()
            .setEndpoint("us-central1-aiplatform.googleapis.com:443")
            .build();

    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings)) {
      String location = "us-central1";
      ModelName modelName = ModelName.of(project, location, modelId);

      Model modelResponse = modelServiceClient.getModel(modelName);
      System.out.println("Get Model response");
      System.out.format("\tName: %s\n", modelResponse.getName());
      System.out.format("\tDisplay Name: %s\n", modelResponse.getDisplayName());
      System.out.format("\tDescription: %s\n", modelResponse.getDescription());

      System.out.format("\tMetadata Schema Uri: %s\n", modelResponse.getMetadataSchemaUri());
      System.out.format("\tMetadata: %s\n", modelResponse.getMetadata());
      System.out.format("\tTraining Pipeline: %s\n", modelResponse.getTrainingPipeline());
      System.out.format("\tArtifact Uri: %s\n", modelResponse.getArtifactUri());

      System.out.format(
          "\tSupported Deployment Resources Types: %s\n",
          modelResponse.getSupportedDeploymentResourcesTypesList());
      System.out.format(
          "\tSupported Input Storage Formats: %s\n",
          modelResponse.getSupportedInputStorageFormatsList());
      System.out.format(
          "\tSupported Output Storage Formats: %s\n",
          modelResponse.getSupportedOutputStorageFormatsList());

      System.out.format("\tCreate Time: %s\n", modelResponse.getCreateTime());
      System.out.format("\tUpdate Time: %s\n", modelResponse.getUpdateTime());
      System.out.format("\tLabels: %s\n", modelResponse.getLabelsMap());

      PredictSchemata predictSchemata = modelResponse.getPredictSchemata();
      System.out.println("\tPredict Schemata");
      System.out.format("\t\tInstance Schema Uri: %s\n", predictSchemata.getInstanceSchemaUri());
      System.out.format(
          "\t\tParameters Schema Uri: %s\n", predictSchemata.getParametersSchemaUri());
      System.out.format(
          "\t\tPrediction Schema Uri: %s\n", predictSchemata.getPredictionSchemaUri());

      for (ExportFormat exportFormat : modelResponse.getSupportedExportFormatsList()) {
        System.out.println("\tSupported Export Format");
        System.out.format("\t\tId: %s\n", exportFormat.getId());
      }

      ModelContainerSpec containerSpec = modelResponse.getContainerSpec();
      System.out.println("\tContainer Spec");
      System.out.format("\t\tImage Uri: %s\n", containerSpec.getImageUri());
      System.out.format("\t\tCommand: %s\n", containerSpec.getCommandList());
      System.out.format("\t\tArgs: %s\n", containerSpec.getArgsList());
      System.out.format("\t\tPredict Route: %s\n", containerSpec.getPredictRoute());
      System.out.format("\t\tHealth Route: %s\n", containerSpec.getHealthRoute());

      for (EnvVar envVar : containerSpec.getEnvList()) {
        System.out.println("\t\tEnv");
        System.out.format("\t\t\tName: %s\n", envVar.getName());
        System.out.format("\t\t\tValue: %s\n", envVar.getValue());
      }

      for (Port port : containerSpec.getPortsList()) {
        System.out.println("\t\tPort");
        System.out.format("\t\t\tContainer Port: %s\n", port.getContainerPort());
      }

      for (DeployedModelRef deployedModelRef : modelResponse.getDeployedModelsList()) {
        System.out.println("\tDeployed Model");
        System.out.format("\t\tEndpoint: %s\n", deployedModelRef.getEndpoint());
        System.out.format("\t\tDeployed Model Id: %s\n", deployedModelRef.getDeployedModelId());
      }
    }
  }
}

Node.js

이 샘플을 사용해 보기 전에 Vertex AI 빠른 시작: 클라이언트 라이브러리 사용Node.js 설정 안내를 따르세요. 자세한 내용은 Vertex AI Node.js API 참고 문서를 참조하세요.

Vertex AI에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

/**
 * TODO(developer): Uncomment these variables before running the sample.\
 * (Not necessary if passing values as arguments)
 */

// const modelId = 'YOUR_MODEL_ID';
// const project = 'YOUR_PROJECT_ID';
// const location = 'YOUR_PROJECT_LOCATION';

// Imports the Google Cloud Model Service Client library
const {ModelServiceClient} = require('@google-cloud/aiplatform');

// Specifies the location of the api endpoint
const clientOptions = {
  apiEndpoint: 'us-central1-aiplatform.googleapis.com',
};

// Instantiates a client
const modelServiceClient = new ModelServiceClient(clientOptions);

async function getModel() {
  // Configure the parent resource
  const name = `projects/${project}/locations/${location}/models/${modelId}`;
  const request = {
    name,
  };
  // Get and print out a list of all the endpoints for this resource
  const [response] = await modelServiceClient.getModel(request);

  console.log('Get model response');
  console.log(`\tName : ${response.name}`);
  console.log(`\tDisplayName : ${response.displayName}`);
  console.log(`\tDescription : ${response.description}`);
  console.log(`\tMetadata schema uri : ${response.metadataSchemaUri}`);
  console.log(`\tMetadata : ${JSON.stringify(response.metadata)}`);
  console.log(`\tTraining pipeline : ${response.trainingPipeline}`);
  console.log(`\tArtifact uri : ${response.artifactUri}`);
  console.log(
    `\tSupported deployment resource types : \
      ${response.supportedDeploymentResourceTypes}`
  );
  console.log(
    `\tSupported input storage formats : \
      ${response.supportedInputStorageFormats}`
  );
  console.log(
    `\tSupported output storage formats : \
      ${response.supportedOutputStoragFormats}`
  );
  console.log(`\tCreate time : ${JSON.stringify(response.createTime)}`);
  console.log(`\tUpdate time : ${JSON.stringify(response.updateTime)}`);
  console.log(`\tLabels : ${JSON.stringify(response.labels)}`);

  const predictSchemata = response.predictSchemata;
  console.log('\tPredict schemata');
  console.log(`\tInstance schema uri : ${predictSchemata.instanceSchemaUri}`);
  console.log(
    `\tParameters schema uri : ${predictSchemata.prametersSchemaUri}`
  );
  console.log(
    `\tPrediction schema uri : ${predictSchemata.predictionSchemaUri}`
  );

  const [supportedExportFormats] = response.supportedExportFormats;
  console.log('\tSupported export formats');
  console.log(`\t${supportedExportFormats}`);

  const containerSpec = response.containerSpec;
  console.log('\tContainer Spec');
  if (!containerSpec) {
    console.log(`\t\t${JSON.stringify(containerSpec)}`);
    console.log('\t\tImage uri : {}');
    console.log('\t\tCommand : {}');
    console.log('\t\tArgs : {}');
    console.log('\t\tPredict route : {}');
    console.log('\t\tHealth route : {}');
    console.log('\t\tEnv');
    console.log('\t\t\t{}');
    console.log('\t\tPort');
    console.log('\t\t{}');
  } else {
    console.log(`\t\t${JSON.stringify(containerSpec)}`);
    console.log(`\t\tImage uri : ${containerSpec.imageUri}`);
    console.log(`\t\tCommand : ${containerSpec.command}`);
    console.log(`\t\tArgs : ${containerSpec.args}`);
    console.log(`\t\tPredict route : ${containerSpec.predictRoute}`);
    console.log(`\t\tHealth route : ${containerSpec.healthRoute}`);
    const env = containerSpec.env;
    console.log('\t\tEnv');
    console.log(`\t\t\t${JSON.stringify(env)}`);
    const ports = containerSpec.ports;
    console.log('\t\tPort');
    console.log(`\t\t\t${JSON.stringify(ports)}`);
  }

  const [deployedModels] = response.deployedModels;
  console.log('\tDeployed models');
  console.log('\t\t', deployedModels);
}
getModel();

Python

Python을 설치하거나 업데이트하는 방법은 Python용 Vertex AI SDK 설치를 참조하세요. 자세한 내용은 Python API 참고 문서를 참조하세요.

def get_model_sample(project: str, location: str, model_name: str):

    aiplatform.init(project=project, location=location)

    model = aiplatform.Model(model_name=model_name)

    print(model.display_name)
    print(model.resource_name)
    return model

다음 단계