Ungraded Lab: KeyError: 'COLAB_TPU_ADDR'

When I execute

tpu_grpc_url = “grpc://” + os.environ[“COLAB_TPU_ADDR”]

I get error message:


Looks like there is no ‘COLAB_TPU_ADDR’ environment variable.
Hardware accelerator in TPU.

Any ideas?


Try in the Connect Option in the upper right hand corner below Comment, click on the arrow and select a unit that has TPU in it. Maybe this fixes your problem.