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

在Azure Kubernetes Service部署AML模型遇CrashLoopBackOff错误求助

解决Azure Kubernetes Service部署Azure ML模型时的CrashLoopBackOff错误

问题根源是你未指定azureml-defaults包的最低要求版本,错误提示明确要求该包版本需**>=1.0.45**,而你当前代码仅添加了包名未限定版本,pip可能安装了低于该要求的旧版本,导致Azure ML服务栈依赖缺失,容器启动失败。

修改后的环境配置代码

env = Environment(name='ocr')
aks_name = 'ocr-compute-2'
aks_target = AksCompute(ws, aks_name)

env.python.conda_dependencies.add_pip_package('google-cloud-vision')
env.python.conda_dependencies.add_pip_package('Pillow')
env.python.conda_dependencies.add_pip_package('Flask == 2.2.2')

# 指定符合要求的azureml-defaults版本
env.python.conda_dependencies.add_pip_package('azureml-defaults>=1.0.45')

inference_config = InferenceConfig(environment=env, source_directory='./', entry_script='./run1.py')

deployment_config = AksWebservice.deploy_configuration(autoscale_enabled=True, 
                                                autoscale_target_utilization=20,
                                                autoscale_min_replicas=1,
                                                autoscale_max_replicas=4)

额外检查项

  • 确保你的推理脚本run1.py遵循Azure ML推理规范,包含init()(用于模型加载)和run()(用于处理推理请求)函数。
  • 重新构建环境并部署,确保新的依赖版本被正确安装到容器中。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.21 15:06:23