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

Azure ML模型注册报错:NoMatchingArtifactsFoundFromJob问题求助

问题

尝试使用已运行实验生成的最优模型创建已注册Azure ML Model,编写代码后出现报错。

代码片段:

import datetime
from azure.ai.ml.entities import (
    Environment,
    BatchEndpoint,
    BatchDeployment,
    BatchRetrySettings,
    Model,
)
from azure.ai.ml.constants import BatchDeploymentOutputAction

model_name = "github-dau-tcn"
batch_endpoint_name = "gdau-batch-" + datetime.datetime.now().strftime("%m%d%H%M%f")

model = Model(
    path=f"azureml://jobs/{best_run.info.run_id}/outputs/artifacts/outputs/model.pt",
    name=model_name,
    description="some name",
)
registered_model = ml_client.models.create_or_update(model)

报错信息:

HttpResponseError: (UserError) 请求无效。详细异常为(NoMatchingArtifactsFoundFromJob) 找不到与outputs/model.pt匹配的作业工件。

怀疑工件未存储在Azure ML指定路径中,需解决该问题。

解决方案
  • 确认作业输出的实际路径

    1. 登录Azure ML工作室,定位到对应best_run.info.run_id的作业
    2. 进入作业的「输出+日志」页面,查看工件的实际存储路径。注意:作业输出的结构可能并非outputs/artifacts/outputs/model.pt,可能是outputs/model、直接的outputs/model.pt或自定义输出目录
    3. 复制正确的工件URI,替换代码中path参数的内容
  • 检查训练代码中的模型保存逻辑
    确保训练代码用Azure ML的方法正确保存模型:

    • 若使用mlflow:
      import mlflow
      mlflow.pytorch.log_model(model, "model")
      
      此时模型的URI路径应为azureml://jobs/{run_id}/outputs/artifacts/model
    • 若使用run.upload_file:
      run.upload_file(name="outputs/model.pt", path_or_stream="./model.pt")
      
      此时路径应为azureml://jobs/{run_id}/outputs/model.pt
  • 验证路径格式正确性
    Azure ML作业输出的URI格式规则:

    • 作业直接输出文件:azureml://jobs/{run_id}/outputs/{output_name}
    • MLflow日志的模型:azureml://jobs/{run_id}/outputs/artifacts/{model_folder_name}

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.18 19:52:13