You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否使用本地计算运行Azure AutoML Forecasting训练任务?

Azure AutoML Forecasting本地训练问题解答

Azure AutoML支持使用本地PC进行训练,但你当前的代码写法不符合SDK v2的要求,导致了报错。

错误原因

SDK v2中,compute参数需要传入具体的计算目标对象(如LocalCompute或AmlCompute实例),而非直接传入字符串"local"。直接传字符串会导致内部逻辑无法识别有效计算资源,触发NoneType' object does not support item assignment错误。

正确实现步骤

  1. 导入LocalCompute类,创建本地计算目标实例
  2. 将该实例传入automl.forecasting()的compute参数

示例代码:

from azure.ai.ml.entities import LocalCompute
from azure.ai.ml import automl

# 创建本地计算目标
local_compute = LocalCompute(name="local")

# 配置预测任务
forecasting_job = automl.forecasting(
    compute=local_compute,
    target_column_name="你的目标列名",
    time_column_name="时间列名",
    forecast_horizon=12,  # 根据你的需求调整
    # 其他必要参数(如训练数据、验证设置等)
)

returned_job = ml_client.jobs.create_or_update(forecasting_job)

额外注意事项

  • 确保本地环境安装了完整的依赖包,可执行命令:pip install azure-ai-ml[automl]
  • 本地训练时,需保证PC有足够的CPU、内存资源来支撑训练任务

内容的提问来源于stack exchange,提问作者michaelmsm89

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 07:17:01