Azure 容器实例部署失败

Azure container instances deployment failed

我正在根据 this article 从 Azure 机器学习服务将机器学习映像部署到 Azure 容器实例,但我总是遇到错误消息:

Aci Deployment failed with exception: Your container application crashed. This may be caused by errors in your scoring file's init() function.
Please check the logs for your container instance xxxxxxx'.

我试过了:

  1. 在 aci_config 中增加 memory_gb=4。
  2. 我做到了 troubleshooting 在本地,但我找不到。

下面是我的score.py

def init():
    global model
    model_path = Model.get_model_path('pofc_fc_model')
    model = joblib.load(model_path)

def run(raw_data):
    data = np.array(json.loads(raw_data)['data'])
    y_hat = model.predict(data)
    return y_hat.tolist()

您是否使用模型对象上的 register() 函数在您的工作区中注册了模型 'pofc_fc_model'?否则,将没有模型路径,这可能会导致失败。

请参阅模型注册部分:https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-deploy-and-where#registermodel