3

I'm new to databricks and deploying models using mlflow and azureml, I'm trying to deploy my model but haven't found a lot of documentation or examples.

I have my model which I save using:

mlflow.sklearn.save_model(model, model_path, 
                          conda_env=conda_env_file_name)

I created the workspace and the aci webservice, the next step is to create the image and the webservice:

# image creation
from azureml.core.image import ContainerImage
myimage_config = ContainerImage.image_configuration(execution_script = driver_file, 
                                                    runtime = "python", 
                                                    conda_file = conda_env_file_name)

# Webservice creation
myservice = AciWebservice.deploy_from_model(
  workspace=ws, 
  name="service",
  deployment_config = aciconfig,
  models = [model_path],
  image_config = myimage_config)

myservice.wait_for_deployment(show_output=True)

However when I try to create the webservice I receive an error and looking at the log:

mlflow.exceptions.MlflowException: Could not find an "MLmodel" configuration file at "mode_path"

My score file init function is like this:

def init():
    global model
    # retreive the path to the model file using the model name
    model_path = Model.get_model_path('model_path')
    model = joblib.load(model_path)

It seems like it cannot find the path to the model. I'm not sure in the moment the image is saved, the model is not saved in it and thus it cannot be found by sklearn.load_model. I'm quite confused cause I've seen that a model can be deployed using mlflow or azureml. I think the problems is that mlflow.save_model does not register the model and then there's no path. Have someone been able to solve this? What is the best way to deploy a model?

Daniel Zapata
  • 812
  • 3
  • 9
  • 31
  • Could it be a typo and you need to change 'mode_path' to 'model_path'? – Raphael K Jun 06 '19 at 12:43
  • @RaphaelK no, I already corrected it. Currently I have found that all libraries versions are the same however even if in my conda environment file I specified python 3.5.2, it installs version 3.6.8. I think this might be the problem. – Daniel Zapata Jun 06 '19 at 14:35

0 Answers0