Skip to content

Instantly share code, notes, and snippets.

@korkridake
Created May 29, 2020 13:06
Show Gist options
  • Save korkridake/f2cc7315611b3a5f1182f4d84e11f34a to your computer and use it in GitHub Desktop.
Save korkridake/f2cc7315611b3a5f1182f4d84e11f34a to your computer and use it in GitHub Desktop.
MLOps Ep.4 Productionizing Training Script (Create an experiment and validate if AMLCompute is already provisioned)
# Create an experiment
experiment_name = 'experiment-regression'
experiment = Experiment(workspace = ws, name = experiment_name)
# Choose a name for your CPU cluster
cpu_cluster_name = "kyledevpc1"
# Verify that cluster does not exist already
try:
cpu_cluster = ComputeTarget(workspace=ws, name=cpu_cluster_name)
print('Do not create a new one! Found existing cluster, please use the existing one.')
except ComputeTargetException:
print('Could not find the existing cluster. Initiate the cluster creation process.')
compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2',
max_nodes=4)
cpu_cluster = ComputeTarget.create(ws, cpu_cluster_name, compute_config)
cpu_cluster.wait_for_completion(show_output=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment