ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

TensorFlow Cloud 是用于将本地环境连接到 Google Cloud 的库。

import tensorflow_cloud as tfc

TF_GPU_IMAGE= "tensorflow/tensorflow:latest-gpu"

run_parameters = [
  distribution_strategy='auto',
  requirements_txt='requirements.txt',
  docker_config=tfc.DockerConfig(
    parent_image=TF_GPU_IMAGE,
    image_build_bucket=GCS_BUCKET
  ),
  chief_config=tfc.COMMON_MACHINE_CONFIGS['K80_1X'],
  worker_config=tfc.COMMON_MACHINE_CONFIGS['K80_1X'],
  worker_count=3,
  job_labels={'job': "my_job"}
]

run(**run_parameters) # Runs your training on Google Cloud!
笔记本中运行
TensorFlow Cloud 代码库提供各种 API,可让您轻松地从在本地构建和调试模型,转换到在 Google Cloud 上进行分布式训练和超参数微调。您可以从 Colab/Kaggle 笔记本或本地脚本文件内部发送模型,以在 Cloud 上直接进行微调或训练,而无需使用 Cloud Console。