Reputation: 875
I am trying to run a code that requires tpu name and zone in config.
Using a TPU runtime, how can I find the TPU name and zone in Google Colab?
Upvotes: 0
Views: 1270
Reputation: 275
Google Colab doesn't expose TPU name or its zone. However you can get the TPU IP using the following code snippet:
tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
print('Running on TPU ', tpu.cluster_spec().as_dict())
Upvotes: 1