【问题标题】:How to upgrade from Colab TPU to paid TPU?如何从 Colab TPU 升级到付费 TPU?
【发布时间】:2020-05-01 15:06:59
【问题描述】:

过去几天我一直在使用 Colab 和 TPU,效果非常好。现在,我想在 GCE 上升级到付费 TPU。我一直在关注这里的快速入门:https://cloud.google.com/tpu/docs/quickstart

我使用 tpu up 创建了一个存储桶和一个 TPU。现在想使用我的笔记本连接到 TPU,该笔记本由 GCP AI 笔记本 (https://console.cloud.google.com/ai-platform/notebooks) 托管。当我在 Colab 上时,我可以使用以下方式访问它:

cluster_resolver = tf.distribute.cluster_resolver.TPUClusterResolver()
tf.config.experimental_connect_to_cluster(cluster_resolver)

当我在 GCP AI Notebook 中运行同一行时...

cluster_resolver = tf.distribute.cluster_resolver.TPUClusterResolver('MyTPUName')
tf.config.experimental_connect_to_cluster(cluster_resolver)

...它会抛出此错误

HttpError: <HttpError 403 when requesting https://tpu.googleapis.com/v1/projects/local-dialect-[MyProjectID]/locations/us-east1-c/nodes/[MyTPUName]?alt=json returned "Location us-east1-c is not found or access is unauthorized.">

我该如何解决?顺便说一句,如果 Google 的任何人正在阅读此内容:如果您要为此产品收取 1-5 美元/小时的费用,那么 Colab 的“升级”按钮怎么样?每个人都赢了。

谢谢!

【问题讨论】:

    标签: jupyter-notebook tpu gcp-ai-platform-notebook


    【解决方案1】:

    原来我需要一些额外的参数才能通过安全性。这有效:

    cluster_resolver = tf.distribute.cluster_resolver.TPUClusterResolver( \
            tpu='[my tpu name]', 
            zone='us-central1-a', 
            project='[my project name]')
    tf.config.experimental_connect_to_cluster(cluster_resolver)
    

    【讨论】:

      猜你喜欢
      • 2020-05-04
      • 2019-07-29
      • 2021-02-19
      • 2019-12-06
      • 1970-01-01
      • 2021-10-05
      • 2021-02-17
      • 2019-03-02
      • 2021-02-06
      相关资源
      最近更新 更多