简体   繁体   中英

How to create AzureML environment for an experiment from conda specification file

I want to use my existing specification file of conda environment for creating AzureML experiment environment. How could we do that?

Create the conda specification file and upload it to any AzureML workspace directory.

Then, use the following command

from azureml.core import Experiment
myenv = Environment.from_pip_requirements(name="myenv", file_path="path-to-pip-requirements-file")

Then, you can use the environment for your experiment.

For example:

src = ScriptRunConfig(source_directory=".",
                      script="example.py",
                      compute_target="local",
                      environment=myenv)

run = myexp.submit(config=src)

run.wait_for_completion(show_output=True)

source_directory is the directory that store the python script of the experiment(training script).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM