GCP:无法连接到云 TPU

GCP: Unable to connect to cloud TPU

我按照 this quick start tutorial using ctpu up command and I was able to run MNIST tutorial successfully. I logged out of cloud shell and logged into my vm connected to TPU using SSH console as explained here 使用 TPU 启动了一个实例,当我再次 运行 MNIST 教程时,我得到了

RuntimeError: Cannot find any TPU cores in the system. Please double check Tensorflow master address and TPU worker(s).

当我 运行 ctpu ls 时,我得到

#       Flock Name      Status
0:      my-tpu(*)  running

ctpu status 命令给出

Your cluster is running!
Compute Engine VM:  RUNNING
Cloud TPU:          RUNNING

我是不是漏掉了一些基本的东西?

ctpu 将此名称作为环境变量 (TPU_NAME) 传递给 Compute Engine VM,但 gcloud 不会。

明确指定您的 TPU:使用 --tpu=my-tpu 而不是 --tpu=$TPU_NAME