简体   繁体   English

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

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

I'm trying to save a little money by starting/stopping AML compute instance using python. However, I'm having a bit of trouble after following instructions here .我试图通过使用 python 启动/停止 AML 计算实例来节省一点钱。但是,按照此处的说明进行操作后我遇到了一些麻烦。

The instructions indicate that the following code should work using Python SDK azure-ai-ml v2:说明表明以下代码应该使用 Python SDK azure-ai-ml v2:

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

However, I get the following error:但是,我收到以下错误:

"message": "StopCompute is not supported for 'AmlCompute' computes." "message": "'AmlCompute' 计算不支持 StopCompute。"

If anyone has had this issue and has a work around, I'd very much appreciate it.如果有人遇到过这个问题并且可以解决,我将非常感激。

To stop an AML compute instance, you can use the following code.要停止 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.

相关问题 Azure 机器学习是否对计算实例收费,即使它们已停止? - Does Azure Machine Learning charge for Compute Instances even when they are stopped? 如何使用 python SDK 将 Azure ML 计算实例分配给用户 - How to assign a Azure ML compute instance to a user using python SDK 无法在运行于 Azure 机器学习实验的脚本中的 python 中安装 python-dotenv - unable to install python-dotenv in python in script running on Azure Machine Learning experiment Azure 机器学习无法从输出文件夹加载 pytorch Model - Azure machine learning unable to load pytorch Model from the outputs folder 使用 Azure 计算实例在远程 HTTPS 上配置 Streamlit 服务器 - Streamlit server configuration on remote HTTPS using Azure Compute Instance 使用 Python 启动 Google Compute 实例 - Starting a Google Compute instance with Python 优雅地停止 azure 容器实例 - gracefully stop azure container instance Azure 机器学习笔记本:ModuleNotFound 错误 - Azure Machine Learning notebooks: ModuleNotFound error 如何在推理脚本中给出 azure 机器学习数据集路径? - How give azure machine learning dataset path in an inference script? 停止并启动深度学习 VM 后找不到 NVIDIA 驱动程序 - Can not find NVIDIA driver after stop and start a deep learning VM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM