繁体   English   中英

无法通过 azure 机器学习使用 python 启动/停止计算实例

[英]Unable to start/stop compute instance through azure machine learning using python

我试图通过使用 python 启动/停止 AML 计算实例来节省一点钱。但是,按照此处的说明进行操作后我遇到了一些麻烦。

说明表明以下代码应该使用 Python SDK azure-ai-ml v2:

ml_client.compute.begin_stop(ci_basic_name).wait()

但是,我收到以下错误:

"message": "'AmlCompute' 计算不支持 StopCompute。"

如果有人遇到过这个问题并且可以解决,我将非常感激。

要停止 AML 计算实例,您可以使用以下代码。

# Import the Azure Machine Learning Python SDK
from azureml.core import Workspace, ComputeInstance

# Load the workspace
ws = Workspace.from_config()

# Get the compute instance
instance = ComputeInstance(ws, "instance-name")

# Stop the compute instance
instance.stop(wait_for_completion=True, show_output=True)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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