参考文档Google Cloud Training job docs
为了获取 AI Platform 的作业状态,你可以使用 GCP 提供的 REST API,参考 jobs AI Platform jobs docs
GET 请求正文:
{
"jobId": string,
"createTime": string,
"startTime": string,
"endTime": string,
"state": enum (State), # This Field is what will tell you status of job
"errorMessage": string,
"labels": {
string: string,
...
},
"etag": string,
// Union field input can be only one of the following:
"trainingInput": {
object (TrainingInput)
},
"predictionInput": {
object (PredictionInput)
}
// End of list of possible types for union field input.
// Union field output can be only one of the following:
"trainingOutput": {
object (TrainingOutput)
},
"predictionOutput": {
object (PredictionOutput)
}
// End of list of possible types for union field output.
}
状态字段是枚举
Enums
STATE_UNSPECIFIED The job state is unspecified.
QUEUED The job has been just created and processing has not yet begun.
PREPARING The service is preparing to run the job.
RUNNING The job is in progress.
SUCCEEDED The job completed successfully.
FAILED The job failed. errorMessage should contain the details of the failure.
CANCELLING The job is being cancelled. errorMessage should describe the reason for the cancellation.
CANCELLED The job has been cancelled. errorMessage should describe the reason for the cancellation.
注意:所有这些都可以通过 python 或任何其他选择的语言来完成。
使用 Python GCP 客户端库