I am trying to run a Machine Learning training script I wrote in azure by using:
env = Environment.from_conda_specification("experiment_env", "my_environment.yml")
script_config = ScriptRunConfig(source_directory=experiment_folder,
script='path_to_file/classifier_train.py',
arguments=arguments,
environment=env,
docker_runtime_config=DockerConfiguration(use_docker=True)
my problem is, that in order to run the code of classifier_train.py
I need to call
pip install -e .
since I need code from a local package I wrote (the setup.py for this package is in the experiment folder).
Can anyone tell me how I can run pip install -e .
after azure installed all other package when building the environment and before running the classifier_train.py
script?
To install local libraries on azure ML environment, we need to create the Data Science VM on the local machine and connect it with the workspace subscription details.
Create ML studio workspace and download the JSON file which consists of the details of the workspace need to be connected to the VM.
conda install notebook ipykernel
– enable all the ipykernal thingsipython kernel install --user --name <myenv>
--display-name "Python (myenv)" – creating a kernelNow we need to get the ARM template by following the procedure taken from MS Docs
Using the following code block create Windows DSVM
az vm create --resource-group YOUR-RESOURCE-GROUP-NAME --name YOUR-VM-NAME --image microsoft-dsvm:dsvm-windows:server-2016:latest --admin-username YOUR-USERNAME --admin-password YOUR-PASSWORD --authentication-type password
Using the following code block create Ubuntu DSVM
az vm create --resource-group YOUR-RESOURCE-GROUP-NAME --name YOUR-VM-NAME --image microsoft-dsvm:linux-data-science-vm-ubuntu:linuxdsvmubuntu:latest --admin-username YOUR-USERNAME --admin-password YOUR-PASSWORD --generate-ssh-keys --authentication-type password
Create conda environment:
conda create -n py310 python=310
Activate the environment and install the libraries locally which are directly impacted in azure ml platform
conda activate py310
pip install azure-ai-ml