microsoft / solution-accelerator-many-models

MIT License
193 stars 85 forks source link

Creating compute target fails #85

Closed robert4os closed 4 years ago

robert4os commented 4 years ago

The cells to create a compute target fail with:

Creating a new compute target...
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-40-c65a1dcc03d1> in <module>
     19                                                            max_nodes=2), # !!! RH instead of 20
     20     # Create the cluster.
---> 21     compute = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)
     22 
     23 print('Checking cluster status...')

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/core/compute/compute.py in create(workspace, name, provisioning_configuration)
    306             raise UserErrorException("Please specify a different target name."
    307                                      " {} is a reserved name.".format(name))
--> 308         compute_type = provisioning_configuration._compute_type
    309         return compute_type._create(workspace, name, provisioning_configuration)
    310 

AttributeError: 'tuple' object has no attribute '_compute_type'

For instance the following cell in notebook '02b_Train_AutoML':

from azureml.core.compute import AmlCompute
from azureml.core.compute import ComputeTarget

# Choose a name for your cluster.
amlcompute_cluster_name = "train-many-model2"

found = False
# Check if this compute target already exists in the workspace.
cts = ws.compute_targets
if amlcompute_cluster_name in cts and cts[amlcompute_cluster_name].type == 'AmlCompute':
    found = True
    print('Found existing compute target.')
    compute = cts[amlcompute_cluster_name]

if not found:
    print('Creating a new compute target...')
    provisioning_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D13_V2',
                                                           min_nodes=0, # !!! RH instead of 2
                                                           max_nodes=2), # !!! RH instead of 20
    # Create the cluster.
    compute = ComputeTarget.create(ws, amlcompute_cluster_name, provisioning_config)

print('Checking cluster status...')
# Can poll for a minimum number of nodes and for a specific timeout.
# If no min_node_count is provided, it will use the scale settings for the cluster.
compute.wait_for_completion(show_output = True, min_node_count = None, timeout_in_minutes = 20)

# For a more detailed view of current AmlCompute status, use get_status().

thank you and best regards, Robert

robert4os commented 4 years ago

Please close this issue. It was a simple syntax error on my side caused by adding comments.