【问题标题】:How can i access model artifacts on google ai platform (unified)?如何访问 google ai 平台(统一)上的模型工件?
【发布时间】:2021-06-12 01:03:38
【问题描述】:

我希望能够从模型中加载数据,但不必使用构建模型的容器来交付数据文件, 我已经使用该命令将模型上传到平台:

gcloud beta ai models upload \
  --display-name=MODEL_NAME \
  --region=us-central1 \
  --container-image-uri=us-central1-docker.pkg.dev/MODEL_URI \
  --container-predict-route=/predict \
  --container-health-route=/health \
  --container-ports=80  \
  --artifact-uri=gs://BUCKET_NAME/DIR_WHERE_DATA_IS

所以,如果在:gs://BUCKET_NAME/DIR_WHERE_DATA_IS 中存在一个名为 foo.bar 的文件 我希望我能够从 docker 构建的代码中读取它,就好像它是本地的一样,对吗? 因为在尝试部署模型时,我找不到那些文件(例如:gs://BUCKET_NAME/DIR_WHERE_DATA_IS 中的“foo.bar”)

【问题讨论】:

    标签: gcloud google-ai-platform


    【解决方案1】:

    指定 --artifact-uri=gs://BUCKET_NAME/DIR_WHERE_DATA_IS 只会使存储桶在平台上运行的容器中具有正确的凭据,您应该阅读数据副本所在的 gcs 路径的 env "AIP_STORAGE_URI" 并从那 uri 你的模型需要的数据 https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#artifacts

    请记住,您还需要在容器中验证您的帐户 How to authenticate google cloud SDK on a docker Ubuntu image?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-15
      • 1970-01-01
      • 2020-05-26
      • 2021-02-23
      • 2022-01-18
      • 2021-05-18
      • 2021-06-19
      • 1970-01-01
      相关资源
      最近更新 更多