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?