I am trying to submit an experiment in Azure Machine Learning service locally on an Azure VM using a ScriptRunConfig
object in my workspace ws
, as in
from azureml.core import ScriptRunConfig
from azureml.core.runconfig import RunConfiguration
from azureml.core import Experiment
experiment = Experiment(ws, name='test')
run_local = RunConfiguration()
script_params = {
'--data-folder': './data',
'--training-data': 'train.csv'
}
src = ScriptRunConfig(source_directory = './source_dir',
script = 'train.py',
run_config = run_local,
arguments = script_params)
run = experiment.submit(src)
However, this fails with
ExperimentExecutionException: { "error_details": { "correlation": { "operation": "bb12f5b8bd78084b9b34f088a1d77224", "request": "iGfp+sjC34Q=" }, "error": { "code": "UserError", "message": "Failed to deserialize run definition"
Worse, if I set my data folder to use a datastore (which likely I will need to)
script_params = {
'--data-folder': ds.path('mydatastoredir').as_mount(),
'--training-data': 'train.csv'
}
the error is
UserErrorException: Dictionary with non-native python type values are not supported in runconfigs.
{'--data-folder': $AZUREML_DATAREFERENCE_d93269a580ec4ecf97be428cd2fe79, '--training-data': 'train.csv'}
I don't quite understand how I should pass my script_params
parameters to my train.py
(the documentation of ScriptRunConfig
doesn't include a lot of details on this unfortunately).
Does anybody know how to properly create src
in these two cases?