mirror of
https://github.com/Azure/MachineLearningNotebooks.git
synced 2025-12-20 09:37:04 -05:00
quickstart added
This commit is contained in:
24
tutorials/get-started-day1/IDE-users/04-run-pytorch.py
Normal file
24
tutorials/get-started-day1/IDE-users/04-run-pytorch.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# 04-run-pytorch.py
|
||||
from azureml.core import Workspace
|
||||
from azureml.core import Experiment
|
||||
from azureml.core import Environment
|
||||
from azureml.core import ScriptRunConfig
|
||||
|
||||
if __name__ == "__main__":
|
||||
ws = Workspace.from_config()
|
||||
experiment = Experiment(workspace=ws, name='day1-experiment-train')
|
||||
config = ScriptRunConfig(source_directory='./src',
|
||||
script='train.py',
|
||||
compute_target='cpu-cluster')
|
||||
|
||||
# set up pytorch environment
|
||||
env = Environment.from_conda_specification(
|
||||
name='pytorch-env',
|
||||
file_path='./environments/pytorch-env.yml'
|
||||
)
|
||||
config.run_config.environment = env
|
||||
|
||||
run = experiment.submit(config)
|
||||
|
||||
aml_url = run.get_portal_url()
|
||||
print(aml_url)
|
||||
Reference in New Issue
Block a user