Hi Diego STUCCHI,
I hope you are doing great!
Thank you for your response and for editing the original answer. On behalf of Sina Salam , I'm posting the updated answer here in case you'd like to accept it.
The fact is that the issue arises because the command
function in the Azure Machine Learning Python SDK (v2) supports only one folder using the code
argument, and you have separate folders for source code, experiment script, and utility functions. Unfortunately, Azure Machine Learning SDK v2 does not currently support uploading multiple folders directly through the command
interface. I wanted to avoid any overhead at the same time, but one practical solution is to consolidate these directories by creating a ZIP file containing all your folders. You can then upload this ZIP as the code
folder, and Azure ML will automatically unzip it on the compute instance. This avoids altering or restructuring your codebase, and in the below is how you can modify your code:
- First, create a ZIP archive of your directories using bash command:
zip -r code_archive.zip path/to/source path/to/experiment path/to/utils
- Then, use the following Python script:
My thought is to preserves your codebase structure and works within the current SDK constraints.from azure.ai.ml import command, Input job = command( inputs=dict( train_data=Input(type="uri_file", path="path/to/train_data"), test_data=Input(type="uri_file", path="path/to/test_data"), ), code="path/to/code_archive.zip", # Use the ZIP file as the code path command='python path/to/experiment/main.py --train-data ${{inputs.train_data}} --test-data ${{inputs.test_data}}', environment="azureml:<your-environment-name>", experiment_name='my_experiment' ) ml_client.create_or_update(job)
Check more details in the Documentation - https://learn.microsoft.com/en-us/azure/machine-learning/how-to-use-azureml-sdk and Azure ML Job Submission Best Practices - https://learn.microsoft.com/en-us/azure/machine-learning/how-to-submit-jobs
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful.