【问题标题】:How to update scoring.py file in deployed azure ml web services without changing the scoring url如何在不更改评分 url 的情况下更新部署的 azure ml Web 服务中的 score.py 文件
【发布时间】:2020-09-06 11:21:13
【问题描述】:

我已经在 ACI 中部署了一个模型,现在我想更改我的 web 服务的 Scoring.py 文件。我试过下面的代码,但它给了我错误

inf_conf = InferenceConfig(entry_script="dcp_pi_main_scoring.py")

#service_name = 'binary-test'
# Retrieve existing service.
service = Webservice(name='binary-test', workspace=ws)
service.update(inference_config=inf_conf)
service.wait_for_deployment(show_output=True)

上面的代码给我错误:

AttributeError: 'NoneType' object has no attribute 'lower'

谁能帮我解决这个问题

【问题讨论】:

  • 能否请您添加有关入口脚本文件以及您正在尝试更新的更多详细信息。
  • 感谢您的回复.. 好的,我会尝试这个,您是否在上面的代码中看到任何错误以及错误是什么

标签: python python-3.x azure azure-machine-learning-studio


【解决方案1】:

在部署推理脚本时,除了入口脚本 (score.py),inferenceConfig 还允许您指定包含入口脚本以及所有其他 python 代码的源目录(包作为源目录中的子文件夹,其中包含自己的 init.py 或纯 python 脚本文件模块)。

score.py 脚本可以直接从中导入,因为整个文件夹包括 score.py 和所有其他文件夹都将在推理运行环境中可用。 https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.model.inferenceconfig?view=azure-ml-py

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-04
    • 2010-09-14
    • 1970-01-01
    • 2019-02-21
    • 2017-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多