Skip to content

Instantly share code, notes, and snippets.

@jzuern
Created November 7, 2018 10:06
Show Gist options
  • Save jzuern/5eb1622622e29ee84d92b565e6a72d66 to your computer and use it in GitHub Desktop.
Save jzuern/5eb1622622e29ee84d92b565e6a72d66 to your computer and use it in GitHub Desktop.
# This address identifies the TPU we'll use when configuring TensorFlow.
TPU_WORKER = 'grpc://' + os.environ['COLAB_TPU_ADDR']
tf.logging.set_verbosity(tf.logging.INFO)
resnet_model = tf.contrib.tpu.keras_to_tpu_model(
resnet_model,
strategy=tf.contrib.tpu.TPUDistributionStrategy(
tf.contrib.cluster_resolver.TPUClusterResolver(TPU_WORKER)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment