如何在 Google Colab 中查找 TPU 名称和区域?

Posted

技术标签:

【中文标题】如何在 Google Colab 中查找 TPU 名称和区域?【英文标题】:How to find TPU name and zone in Google Colab? 【发布时间】:2021-07-04 05:03:05 【问题描述】:

我正在尝试在配置中运行需要 tpu 名称和区域的代码。

使用 TPU 运行时,如何在 Google Colab 中找到 TPU 名称和区域?

【问题讨论】:

【参考方案1】:

Google Colab 不会公开 TPU 名称或其区域。 但是,您可以使用以下代码 sn-p 获取 TPU IP:

tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
print('Running on TPU ', tpu.cluster_spec().as_dict())

【讨论】:

以上是关于如何在 Google Colab 中查找 TPU 名称和区域?的主要内容,如果未能解决你的问题,请参考以下文章

Google Colab TPU 中未实现文件系统方案“[本地]”

为啥 Google Colab TPU 和我的电脑一样慢?

在 Google Colab Pro 中使用 TPU v3

使用 TPU 运行时在 Google Colab 上训练 Keras 模型时出错

Google Colab 中的 Keras 调谐器和 TPU

使用 GOOGLE COLAB TPU 在 IMAGENET 上训练 VGG-16 模型需要多长时间?