Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
for local computer
  • Loading branch information
sdgilley committed Jan 4, 2019
commit 3c581b533f0e4f79fa53919f891f0602314d9aa6
42 changes: 42 additions & 0 deletions ignore/doc-qa/how-to-set-up-training-targets/Local.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Code for Local computer and Submit training run sections

# Check core SDK version number
import azureml.core

print("SDK version:", azureml.core.VERSION)

#<local_env>
from azureml.core.runconfig import RunConfiguration

# Edit a run configuration property on the fly.
run_local = RunConfiguration()

run_local.environment.python.user_managed_dependencies = True

# Choose a specific Python environment by pointing to a Python path. For example:
# run_config.environment.python.interpreter_path = '/home/ninghai/miniconda3/envs/sdk2/bin/python'
#</local_env>

from azureml.core import Workspace
ws = Workspace.from_config()


# Set up an experiment
# <experiment>
from azureml.core import Experiment
experiment_name = 'my_experiment'

exp = Experiment(workspace=ws, name=experiment_name)
# </experiment>

# Submit the experiment using the run configuration
#<local_submit>
from azureml.core import ScriptRunConfig
import os

script_folder = os.getcwd()
src = ScriptRunConfig(source_directory = script_folder, script = 'train.py', run_config = run_local)
run = exp.submit(src)
run.wait_for_completion(show_output = True)
#</local_submit>