HyperDriveStep dose not accept ScriptRunConfig as a valid run_confic
- Package Name: azureml.train.hyperdrive.HyperDriveConfig()
- Package Version: azureml-train==1.20.0, azureml-core==1.20.0
- Operating System: Windows 10
- Python Version: 3.8.5
Describe the bug
when I create a pipeline step for hyperdrive and specify the run_config parameter as a ScriptRunConfig object, initialization of HyperDriveStep fails because ScriptRunConfig has no attribute 'data_references'.
To Reproduce Steps to reproduce the behavior:
- create a ScriptRunConfig object with a training script
run_config = ScriptRunConfig( source_directory=source_directory, script="train.py",
environment= Environment.get(ws, name="xgb-hp"),
compute_target= compute_cluster)
- create a HyperdriveConfig object with this ScriptRunConfig.
hyperdrive_config = HyperDriveConfig( run_config=run_config,
hyperparameter_sampling=bayesian_sampling,
primary_metric_name='test-mae-mean',
primary_metric_goal=PrimaryMetricGoal.MINIMIZE,
max_total_runs=60,
max_concurrent_runs=3
)
- try to create a HyperDriveStep object of a pipeline with this HyperdriveConfig
hyperdrive_step = HyperDriveStep(
name='storeys:hyperdrive',
hyperdrive_config=hyperdrive_config,
estimator_entry_script_arguments=[],
inputs=[train_dataset.as_input('train')],
outputs=[params_dataset],
)
Expected behavior A clear and concise description of what you expected to happen. HyperDriveStep should hot ask ScriptRunConfig for this atribute Screenshots If applicable, add screenshots to help explain your problem.
this is the Error stack:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-57-26fcafea004b> in <module>
1 # creates the hyperdirve pipeleine step
----> 2 hyperdrive_step = HyperDriveStep(
3 name='storeys:hyperdrive',
4 hyperdrive_config=hyperdrive_config,
5 estimator_entry_script_arguments=[],
~\.conda\envs\AML-prep-xgb\lib\site-packages\azureml\pipeline\steps\hyper_drive_step.py in __init__(self, name, hyperdrive_config, estimator_entry_script_arguments, inputs, outputs, metrics_output, allow_reuse, version)
188 if run_config.arguments:
189 raise ValueError('arguments in run_config should not be provided. Please use arguments in the step')
--> 190 if run_config.data_references:
191 raise ValueError('data_references in run_config should not be provided. Please use inputs in the step')
192
AttributeError: 'ScriptRunConfig' object has no attribute 'data_references'`
Additional context Add any other context about the problem here.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 79bd5e63-af29-ac4a-2689-93746107f8e7
- Version Independent ID: 7af884a7-b7e0-953a-1da9-403aaf3a3b68
- Content: azureml.pipeline.steps.hyper_drive_step.HyperDriveStep class - Azure Machine Learning Python
- Content Source: AzureML-Docset/stable/docs-ref-autogen/azureml-pipeline-steps/azureml.pipeline.steps.hyper_drive_step.HyperDriveStep.yml
- Service: machine-learning
- Sub-service: core
- GitHub Login: @DebFro
- Microsoft Alias: debfro
can you run pip list | grep azureml to show the versions of other azureml packages?
can you run
pip list | grep azuremlto show the versions of other azureml packages?
Package Version
------------------------------------ -------------------
...
azure-common 1.1.26
azure-core 1.10.0
azure-graphrbac 0.61.1
azure-identity 1.4.1
azure-mgmt-authorization 0.61.0
azure-mgmt-containerregistry 2.8.0
azure-mgmt-keyvault 2.2.0
azure-mgmt-resource 12.0.0
azure-mgmt-storage 11.2.0
azureml-automl-core 1.20.0
azureml-core 1.20.0
azureml-dataprep 2.7.3
azureml-dataprep-native 27.0.0
azureml-dataprep-rslex 1.5.0
azureml-dataset-runtime 1.20.0
azureml-defaults 1.20.0
azureml-model-management-sdk 1.0.1b6.post1
azureml-pipeline 1.20.0
azureml-pipeline-core 1.20.0
azureml-pipeline-steps 1.20.0
azureml-sdk 1.20.0
azureml-telemetry 1.20.0
azureml-train 1.20.0
azureml-train-automl-client 1.20.0
azureml-train-core 1.20.0
azureml-train-restclients-hyperdrive 1.20.0
...
Hello masgra,
Thank you for opening this ticket. I need a resolution as well - thus I'm subscribed to this thread. In the interim, nonetheless, I'm unfortunately using the now deprecated 'Estimator' object to push through this HyperDriveStep workflow:
est = Estimator(
source_directory=train_model_folder,
compute_target=aml_compute,
entry_script="train.py",
environment_definition=sklearn_env
)
hyperdrive_config = HyperDriveConfig(estimator=est,
policy=early_termination_policy,
hyperparameter_sampling=ps,
primary_metric_name="AUC_weighted",
primary_metric_goal=PrimaryMetricGoal.MAXIMIZE,
max_total_runs=20,
max_concurrent_runs=4)
hd_step = HyperDriveStep(
name=hd_step_name,
hyperdrive_config=hyperdrive_config,
estimator_entry_script_arguments=[],
inputs=[output_split_train.parse_parquet_files(), output_split_test.parse_parquet_files()],
outputs=[metrics_data, saved_model],
allow_reuse=True)
As you can see, I'm using the Estimator object and also referencing it in the HyperDriveConfig object using the 'estimator' parameter. Not the best but hope it helps for now until we get some resolution.
Thanks!
Hello, this is a known issue and the team is actively working on it
Great suggestion, Temi Wale! Following the warning about the deprecation of Estimators, I started to make changes to some projects I maintain and I encountered this error.
I should add that this error disappears if you submit the HyperDrive Config itself. This is useful in cases where you're not implementing a pipeline.
Has this been resolved yet? I am running into this issue as well on an ongoing project. It seemed that the Estimator was not working anymore either and as far as I know those are the only two choices.
It seemed that the Estimator was not working anymore either and as far as I know those are the only two choices.
I think it is not published yet. But Estimator still works for me me with azureml-sdk v1.20.0.
I was having some issues installing packages with the Estimator using the pip_packages and conda_packages arguments. Switching to a conda dependencies file seemed to fix the issue so I will keep using the Estimator.
I am having the same issue, but using the Estimator works.
Hi @lostmygithubaccount Have you solved this problem? Do we have to Estimator with hyperdrivestep in pipeline now or have you solved data_reference issue with ScriptRunConfig?
this was fixed in 1.22, are you still experiencing issues?
Per the above post, this issue was resolved with a fix last month. We'll now close this issue. Please reopen it if it's still a problem.
this was fixed in 1.22, are you still experiencing issues?
Issue still persists, and as mentioned in the comments, work-around with Estimator works.