azureml-examples
azureml-examples copied to clipboard
AutoML training fails with the message "PipelineRunException: Pipeline execution failed with KeyError: 'squared_error'"
Operating System
Linux
Version Information
Can be reproduced on training environment using AutoML SDK 1.52
Steps to reproduce
- Submit an AutoML training job for tasks like regression, classification, forecasting.
- While submitting the job, limit the allowed algorithms to
ExtremeRandomTrees - Check the training environment being used by the job (it will be using older SDK version, we were able to repro issue on SDK 1.52).
- The training job fails with the mentioned error.
Expected behavior
The training job should succeed.
Actual behavior
The training job fails.
Addition information
- Please note that the algorithms involving tree are impacted.
- If the training job is allowed to only utilize tree models, and the run uses older training environment (using AutoML SDK 1.52), then this issue happens.
- Here is the entire failure message:
Class: PipelineRunException
Message: PipelineRunException:
Message: PipelineRunException: 'squared_error'
InnerException: KeyError: 'squared_error'
ErrorResponse
{
"error": {
"code": "SystemError",
"message": "Encountered an internal AutoML error. Error Message/Code: PipelineRunException. Additional Info: PipelineRunException:\n\tMessage: PipelineRunException: 'squared_error'\n\tInnerException: None\n\tErrorResponse \n{\n \"error\": {\n \"message\": \"PipelineRunException: 'squared_error'\"\n }\n}",
"details_uri": "https://aka.ms/automltroubleshoot",
"inner_error": {
"code": "ClientError",
"inner_error": {
"code": "AutoMLInternal"
}
}
}
}
Traceback:
File "telemetry_activity_logger.py", line 58, in _log_activity
yield
File "pipeline_run_helper.py", line 337, in run_pipeline
raise PipelineRunException.from_exception(status)
File "resource_limits.py", line 110, in wrapped
result = func(*args, **kwargs)
File "runner.py", line 437, in _run
scores, fit_times, fit_model = self._run_cv(
File "runner.py", line 278, in _run_cv
fit_time = _ml_engine.train(m, MaterializedTabularData(X_train, y_train, sample_wt_train))
File "train.py", line 32, in train
return fit_scikit_pipeline(pipeline, training_data)
File "train.py", line 73, in fit_scikit_pipeline
pipeline.fit(training_data.X, training_data.y, **kwargs)
File "pipeline.py", line 354, in fit
self._final_estimator.fit(Xt, y, **fit_params)
File "_forest.py", line 377, in fit
trees = Parallel(n_jobs=self.n_jobs, verbose=self.verbose,
File "parallel.py", line 1098, in __call__
self.retrieve()
File "parallel.py", line 975, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "pool.py", line 771, in get
raise self._value
File "pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "_parallel_backends.py", line 620, in __call__
return self.func(*args, **kwargs)
File "parallel.py", line 288, in __call__
return [func(*args, **kwargs)
File "parallel.py", line 288, in <listcomp>
return [func(*args, **kwargs)
File "_forest.py", line 165, in _parallel_build_trees
tree.fit(X, y, sample_weight=curr_sample_weight, check_input=False)
File "_classes.py", line 1221, in fit
super().fit(
File "_classes.py", line 328, in fit
criterion = CRITERIA_REG[self.criterion](self.n_outputs_,
Solution
Either of the following approach can help avoid this issue:
- Allow algorithms apart from
ExtremeRandomTreesto run. This can be specified while submitting the AutoML job. If nothing is provided in the allowed algorithms, we will try to run as many algorithms as possible within the timeout. - Use the latest training environment. Make sure that the environment version isn't hardcoded in your scripts and notebooks. Upgrade the SDK in the environment from where you are submitting the job by running
pip install azureml-sdk --upgrade.