I am currently encountering an issue that I have been unable to resolve. Despite seeming straightforward, it has proven to be quite challenging.
I am attempting to execute a Python script via a command from azure.ai.ml. My script incorporates an XGBoost model, which necessitates a customized environment. I have made several attempts to customize the environment within the command, but each attempt has resulted in an error message indicating that I need to assign a version to the environment. Interestingly, the Environment class does not accept a version as it is not an argument within that class.
Could you please provide guidance on how I can resolve this issue?
I appreciate your assistance and look forward to your response.
Best regards, Saeed
custom_env = Environment.from_conda_specification(name="custom_env", file_path="conda_env.yml")
custom_env.register(workspace=ws)
# configure job
job = command(
code="./src",
command="python train-model-script.py --training_data ./data/energy_data.xlsx",
environment="env-name",
compute="aml-cluster",
display_name="building-energy-train",
experiment_name="building-energy-training",
tags={"model_type": "XGBOOST", "model":"Building energy dataset"}
)
# submit job
returned_job = ml_client.create_or_update(job)
aml_url = returned_job.studio_url
yamle file:
name: my_env
dependencies:
- python
- scikit-learn
- xgboost
- argparse
- numpy
- pandas
- matplotlib