Created
May 29, 2020 13:06
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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