azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

'HyperDriveStep' requires 'ScriptRunConfig' to have attribute called 'data_references'

Open masgra opened this issue 5 years ago • 3 comments

  • Package Name: azureml.train.hyperdrive.HyperDriveConfig()
  • Package Version: 1.0.1b6.pos1
  • 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:

  1. 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)
  1. 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
    )
  1. 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.

masgra avatar Jan 21 '21 15:01 masgra

@masgra Hi, I have same problem. How did you solve it?

CakmakMuhammet avatar Mar 08 '21 12:03 CakmakMuhammet

Should be fixed with the newest version of AML SDK. If you can't update, you are stuck with using Estimator

masgra avatar Mar 08 '21 22:03 masgra

Should be fixed with the newest version of AML SDK. If you can't update, you are stuck with using Estimator

Yes. It works now. Thanks

CakmakMuhammet avatar Mar 12 '21 12:03 CakmakMuhammet