![](/img/trans.png)
[英]Does Azure Machine Learning charge for Compute Instances even when they are stopped?
[英]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.