user1340852
user1340852

Reputation: 875

How to find TPU name and zone in Google Colab?

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

Answers (1)

aman2930
aman2930

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

Related Questions