kaggle 设置TPU/GPU

kaggle 设置TPU/GPU

tpu = None
try:
    tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
    tf.config.experimental_connect_to_cluster(tpu)
    tf.tpu.experimental.initialize_tpu_system(tpu)
    strategy = tf.distribute.experimental.TPUStrategy(tpu)
except ValueError:
    tf.config.optimizer.set_jit(enabled = "autoclustering")
    strategy = tf.distribute.get_strategy()
AUTOTUNE = tf.data.experimental.AUTOTUNE  

你可能感兴趣的:(tricks,windows,单元测试,数据库)