简体   繁体   中英

how to create AzureML environment from a pip requirements file

I am very comfortable with creating environment from a requirements file using pip. Could i create the same type of environment from requirements file for AzureML experiment?

First we have to create a requirements file and store it in directory in AzureML workspace directory.

myenv = Environment.from_pip_requirements(name="myenv", file_path="path-to-pip-requirements-file")

Then, we can use it for our 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)

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