Lab Assignment 1, Exercise 3

When trying to run Exercise 3 in Assignment 1 I am getting this error…
File “”, line 5
include_cls_metadata=False,
^
SyntaxError: invalid syntax

Here is the code I am using:

tuner.fit(
### BEGIN SOLUTION - DO NOT delete this comment for grading purposes
inputs=data_channels # Replace None
### END SOLUTION - DO NOT delete this comment for grading purposes
include_cls_metadata=False,
wait=False
)

Here is the code I used earlier for data_channels:

from sagemaker.inputs import TrainingInput

data_channels = {
### BEGIN SOLUTION - DO NOT delete this comment for grading purposes
‘train’: TrainingInput(s3_data=processed_train_data_s3_uri), # Replace None
‘validation’: TrainingInput(s3_data=processed_validation_data_s3_uri) # Replace None
### END SOLUTION - DO NOT delete this comment for grading purposes
}

And the code I am using for Hyperparameter Tuner:

from sagemaker.tuner import HyperparameterTuner

tuner = HyperparameterTuner(
### BEGIN SOLUTION - DO NOT delete this comment for grading purposes
estimator=estimator, # Replace None
hyperparameter_ranges=hyperparameter_ranges, # Replace None
metric_definitions=metric_definitions, # Replace None
strategy=‘Random’, # Replace None
### END SOLUTION - DO NOT delete this comment for grading purposes
objective_type=‘Maximize’,
objective_metric_name=‘validation:accuracy’,
max_jobs=2, # maximum number of jobs to run
max_parallel_jobs=2, # maximum number of jobs to run in parallel
early_stopping_type=‘Auto’ # early stopping criteria
)

Hi @tjamesbu!

It seems that you have missed a comma after data_channels. That’s why it is accusing syntax error. Please try out as below:

...
inputs=data_channels, # Replace None
...

Let me know.

Cheers!