【发布时间】:2021-02-20 10:19:46
【问题描述】:
有没有办法在 Google Colab Pro 中使用 TPU v3 而不是 TPU v2?
很遗憾,我在 TPU v2 中收到一条错误消息 Compilation failure: Ran out of memory in memory space hbm. Used 8.29G of 7.48G hbm. Exceeded hbm capacity by 825.60M.,而在 TPU v3 中我不再收到该消息。因为 TPU v3 有更多内存。
有人知道可能性/选项吗?
这样我就启动了 TPU
try:
tpu = tf.distribute.cluster_resolver.TPUClusterResolver() # TPU detection
print('Running on TPU ', tpu.cluster_spec().as_dict()['worker'])
except ValueError:
raise BaseException('ERROR: Not connected to a TPU runtime; please see the previous cell in this notebook for instructions!')
tf.config.experimental_connect_to_cluster(tpu)
tf.tpu.experimental.initialize_tpu_system(tpu)
#tpu_strategy = tf.distribute.experimental.TPUStrategy(tpu)
strategy = tf.distribute.TPUStrategy(tpu)
【问题讨论】:
标签: python tensorflow google-cloud-tpu google-colaboratory