gpt4 book ai didi

尝试部署模型时 Azure 机器学习失败

转载 作者:行者123 更新时间:2023-11-30 08:56:16 24 4
gpt4 key购买 nike

我目前正在尝试在 azure 上部署模型并将其端点公开给我的应用程序,但我一直遇到错误

部署代码

model = run.register_model(model_name='pytorch-modeloldage', model_path="outputs/model") print("Starting.........")

inference_config = InferenceConfig(runtime= "python",
entry_script="pytorchscore.py",
conda_file="myenv.yml")

aciconfig = AciWebservice.deploy_configuration(cpu_cores=1,auth_enabled=True,
memory_gb=1,
tags={'name':'oldageml', 'framework': 'pytorch'},
description='oldageml training')

service = Model.deploy(workspace=ws,
name='pytorch-olageml-run',
models=[model],
inference_config=inference_config,
overwrite=True,
deployment_config=aciconfig)

service.wait_for_deployment(True)
# print(service.get_logs()) print("bruh did you run", service.scoring_uri) print(service.state)

错误

ERROR - Service deployment polling reached non-successful terminal state, current service state: Transitioning
More information can be found here:
Error:
{
"code": "EnvironmentBuildFailed",
"statusCode": 400,
"message": "Failed Building the Environment."
}

最佳答案

我也遇到了这个错误,几天前我确信它可以正常工作!不管怎样,我意识到我在环境定义中使用了 python 3.5。我把它改成了 3.6 并且它可以工作了!我注意到 2019 年 12 月 9 日发布了 azureml-code 的新版本。

这是我改变环境的代码;我像您一样为变量而不是文件添加环境,所以有点不同。

myenv=Environment(name="env-keras")
conda_packages = ['numpy']
pip_packages = ['tensorflow==2.0.0', 'keras==2.3.1', 'azureml-sdk','azureml-defaults']
mycondaenv = CondaDependencies.create(conda_packages=conda_packages, pip_packages=pip_packages, python_version='3.6.2')
myenv.python.conda_dependencies=mycondaenv
myenv.register(workspace=ws)

inference_config = InferenceConfig(entry_script='score.py',source_directory='.',environment=myenv)

关于尝试部署模型时 Azure 机器学习失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59376866/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com