【问题标题】:I failed to submit the training operation on the AI platform of GCP我在GCP的AI平台上提交训练操作失败
【发布时间】:2020-02-27 09:35:31
【问题描述】:

我在GCP的AI平台上提交训练操作失败,报错“xxx@gmail.com没有storage.objects.create access to your-bucket-name/fcnndemo/trainer/packages/980a4aa0a09719cf43f04580d8e6c218346e3ad085e3f48fd11b79ec57a702fe/ ai_platform_demo-0.0.0.tar.gz。”

我正在尝试使用 GEE 中的数据并将其提交给 AI 平台进行训练。我正在 Colab 笔记本上运行它。

import time

# INSERT YOUR PROJECT HERE!
PROJECT = 'your-project'

JOB_NAME = 'demo_training_job_' + str(int(time.time()))
TRAINER_PACKAGE_PATH = 'ai_platform_demo'
MAIN_TRAINER_MODULE = 'ai_platform_demo.task'
REGION = 'us-central1'

!gcloud ai-platform jobs submit training {JOB_NAME} \
    --job-dir {config.JOB_DIR}  \
    --package-path {TRAINER_PACKAGE_PATH} \
    --module-name {MAIN_TRAINER_MODULE} \
    --region {REGION} \
    --project {PROJECT} \
    --runtime-version 1.14 \
    --python-version 3.5 \
    --scale-tier basic-gpu

为什么我没有 storage.objects.create 访问权限?

【问题讨论】:

  • 你知道你现在的角色吗?您当前连接的用户?执行此命令!gcloud config list 以了解更多信息。我们同意您仅为此帖子更改了值(your-bucket-nameyour-project),但实际上,这些值是正确的,您可以访问这些资源吗?

标签: google-cloud-platform google-colaboratory google-earth-engine gcp-ai-platform-training


【解决方案1】:

为了拥有 storage.objects.create 权限,您需要使用 Cloud IAM 权限将其授予您的用户。在this link 中,您将找到有关如何控制谁可以访问您的存储桶和对象的说明。

为了对其进行测试,我已通过this 成功提交了来自 Google Colab 的培训作业。确保使用您的用户使用命令“!gcloud auth login”登录。

我使用的代码如下:

!gcloud auth login
BUCKET_NAME=’<<YOUR_BUCKET>>’
REGION='europe-west1'
JOB_NAME='test_job'
JOB_DIR='gs://<<YOUR_BUCKET>>/keras-job-dir'

!git clone --depth 1 https://github.com/GoogleCloudPlatform/cloudml-samples
!cd cloudml-samples/census/tf-keras/ && ls -pR && pip install -r requirements.txt


!gcloud ai-platform jobs submit training $JOB_NAME \
  --package-path cloudml-samples/census/tf-keras/trainer/ \
  --module-name trainer.task \
  --region {REGION} \
  --python-version 3.5 \
  --runtime-version 1.13 \
  --job-dir $JOB_DIR \
  --stream-logs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-20
    • 2019-11-17
    • 2021-11-01
    • 2019-07-13
    • 1970-01-01
    • 2020-11-21
    • 2019-11-27
    • 2018-09-25
    相关资源
    最近更新 更多