Google colab在运行时加速器中引入了TPU . 我找到了一个例子,如何在Official Tensorflow github中使用TPU . 但这个例子并不适用于Google-colaboratory . 它停留在以下行:
tf.contrib.tpu.keras_to_tpu_model(model, strategy=strategy)
当我在colab上它返回 []
用于TPU加速器 . 有谁知道如何在colab上使用TPU?
Google colab在运行时加速器中引入了TPU . 我找到了一个例子,如何在Official Tensorflow github中使用TPU . 但这个例子并不适用于Google-colaboratory . 它停留在以下行:
tf.contrib.tpu.keras_to_tpu_model(model, strategy=strategy)
当我在colab上它返回 []
用于TPU加速器 . 有谁知道如何在colab上使用TPU?
1 回答
这是一个特定于Colab的TPU示例:https://colab.research.google.com/github/tensorflow/tpu/blob/master/tools/colab/shakespeare_with_tpu_and_keras.ipynb
关键线是连接到TPU本身的那些:
(与GPU不同,使用TPU需要与TPU工作人员明确连接 . 因此,您需要调整训练和推理定义以观察加速 . )