You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation of AutoMLJobV2._load_config, and the corresponding AutoMLV2.fit() documentation appear to be confused about exactly what types of input should be supported, leading to incomplete handling and the below error in some cases:
UnboundLocalError: local variable 'input_config' referenced before assignment
Specifically, I would really like if AutoMLJobV2 could support fit() on plain S3 URI inputs like v1 AutoML.fit() did. It seems like the code might've been set up to not fully implement this possibility but not exclude it either?
To reproduce
Try to fit() an AutoMLV2 estimator using a plain S3 URI dataset instead of creating LocalAutoMLDataChannel objects:
Expected behavior
Like AutoMLV1, AutoMLV2 should recognise the S3 URI specification and map it to an input dataset with sensible defaults for the other LocalAutoMLDataChannel settings.
Screenshots or logs
UnboundLocalError Traceback (most recent call last)
Cell In[12], line 26
12 print(f"Uploaded feature specification JSON to:\n{fspec_s3uri}")
14 automl = AutoMLV2Estimator(
15 problem_config=AutoMLTabularConfig(
16 target_attribute_name="y",
(...)
23 output_path=f"s3://{bucket_name}/{bucket_prefix}/automl",
24 )
---> 26 automl.fit(raw_data_s3uri, wait=False)
File /opt/conda/lib/python3.10/site-packages/sagemaker/automl/automlv2.py:819, in AutoMLV2.fit(self, inputs, wait, logs, job_name)
817 self._prepare_for_auto_ml_job(job_name=job_name)
818 self.inputs = inputs
--> 819 self.latest_auto_ml_job = AutoMLJobV2.start_new(self, inputs) # pylint: disable=W0201
820 if wait:
821 self.latest_auto_ml_job.wait(logs=logs)
File /opt/conda/lib/python3.10/site-packages/sagemaker/automl/automlv2.py:1380, in AutoMLJobV2.start_new(cls, auto_ml, inputs)
1365 @classmethod
1366 def start_new(cls, auto_ml, inputs):
1367 """Create a new Amazon SageMaker AutoMLV2 job from auto_ml_v2 object.
1368
1369 Args:
(...)
1378 all information about the started AutoMLV2 job.
1379 """
-> 1380 auto_ml_args = cls._get_auto_ml_v2_args(auto_ml, inputs)
1382 auto_ml.sagemaker_session.create_auto_ml_v2(**auto_ml_args)
1383 return cls(auto_ml.sagemaker_session, auto_ml.current_job_name, inputs)
File /opt/conda/lib/python3.10/site-packages/sagemaker/automl/automlv2.py:1357, in AutoMLJobV2._get_auto_ml_v2_args(cls, auto_ml, inputs)
1343 @classmethod
1344 def _get_auto_ml_v2_args(cls, auto_ml, inputs):
1345 """Constructs a dict of arguments for an Amazon SageMaker AutoMLV2 job.
1346
1347 Args:
(...)
1355 Dict: dict for `sagemaker.session.Session.auto_ml` method
1356 """
-> 1357 config = cls._load_config(inputs, auto_ml)
1358 auto_ml_args = config.copy()
1359 auto_ml_args["job_name"] = auto_ml.current_job_name
File /opt/conda/lib/python3.10/site-packages/sagemaker/automl/automlv2.py:1423, in AutoMLJobV2._load_config(cls, inputs, auto_ml, expand_role)
1418 role = auto_ml.sagemaker_session.expand_role(auto_ml.role) if expand_role else auto_ml.role
1420 problem_config = auto_ml.problem_config.to_request_dict()
1422 config = {
-> 1423 "input_config": input_config,
1424 "output_config": output_config,
1425 "problem_config": problem_config,
1426 "role": role,
1427 "job_objective": auto_ml.job_objective,
1428 }
1430 if (
1431 auto_ml.volume_kms_key
1432 or auto_ml.vpc_config
1433 or auto_ml.encrypt_inter_container_traffic is not None
1434 ):
1435 config["security_config"] = {}
UnboundLocalError: local variable 'input_config' referenced before assignment
System information
A description of your system. Please provide:
SageMaker Python SDK version: 2.224.1
Framework name (eg. PyTorch) or algorithm (eg. KMeans): AutoMLV2
Framework version: -
Python version: 3.10.14
CPU or GPU: CPU
Custom Docker image (Y/N): N
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
The implementation of AutoMLJobV2._load_config, and the corresponding AutoMLV2.fit() documentation appear to be confused about exactly what types of input should be supported, leading to incomplete handling and the below error in some cases:
Specifically, I would really like if AutoMLJobV2 could support
fit()
on plain S3 URI inputs like v1 AutoML.fit() did. It seems like the code might've been set up to not fully implement this possibility but not exclude it either?To reproduce
Try to
fit()
an AutoMLV2 estimator using a plain S3 URI dataset instead of creating LocalAutoMLDataChannel objects:Expected behavior
Like AutoMLV1, AutoMLV2 should recognise the S3 URI specification and map it to an input dataset with sensible defaults for the other LocalAutoMLDataChannel settings.
Screenshots or logs
System information
A description of your system. Please provide:
Additional context
N/A
The text was updated successfully, but these errors were encountered: