3

I am deploying a machine learning image to Azure Container Instances from Azure Machine Learning services according to this article, but am always stuck with the error message:

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'.

I tried:

  1. increasing memory_gb=4 in aci_config.
  2. I did troubleshooting locally, but I could not have found any.

Below is my 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()
Davide Fiocco
  • 5,350
  • 5
  • 35
  • 72
sauceishere
  • 326
  • 5
  • 15

1 Answers1

1

Have you registered the model 'pofc_fc_model' in your workspace using the register() function on the model object? If not, there will be no model path and that can cause failure.

See this section on model registration: https://learn.microsoft.com/en-us/azure/machine-learning/service/how-to-deploy-and-where#registermodel

Trevor Bye
  • 686
  • 1
  • 6
  • 26