Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,838 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This code is creating a local run with sdk2, and I want to cancel this job, how can I do this?
#import required libraries
from azure.ai.ml import MLClient, command
from azure.ai.ml.entities import Environment
from azure.identity import DefaultAzureCredential
#connect to the workspace
ml_client = MLClient.from_config(DefaultAzureCredential())
# set up pytorch environment
env = Environment(
image='mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04',
conda_file='pytorch-env.yml',
name='pytorch-env'
)
# define the command
command_job = command(
code='./src',
command='train.py',
environment=env,
compute='local',
)
returned_job = ml_client.jobs.create_or_update(command_job)
returned_job
@sara rezaei Are you using local compute in this case? With local compute I think the cancel operation is not supported.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.