I'm trying to start a training job on Azure ML from an Azure function (blob trigger) using Python. Here're the two ways I've seen it done:
inputs=dict(
data_folder=Input(type="uri_folder", path=web_path)
),
compute=gpu_compute_target,
environment=curated_env_name,
code="./src/",
command="python tf_mnist.py --data-folder ${{inputs.data_folder}}",
experiment_name="tf-dnn-image-classify",
display_name="tensorflow-classify-mnist-digit-images-with-dnn",
)
ml_client.jobs.create_or_update(job)
script='train.py',
arguments=['--input-data-dir', dataset.as_named_input('input').as_mount(),
'--reg', '0.99'],
run_config=run_config)
run = experiment.submit(config=src)
What is the difference between these? My source code is in a remote repo and this bit of code would be running in an Azure function. Which of these methods is suitable for my scenario?
They key difference between those methods is just the version of the SDK/API that they are using.
azure.ai.ml
is coming from the Python SDK V2, contained in the Python package azure-ai-ml
. More details about, including how to install it, can be found hereazureml-core
. Instructions here.I would suggest using the V2 SDK, it is clearly more future-proof (though of course you may hit some snags for now because the V2 SDK is still in preview mode). Our team are also now switching from V1 to V2.