I have trained a machine learning model through python locally and I'm trying to deploy it to Azure with inference cluster. I'm able to train, upload data, register model but I'm unable to deploy the model. It's throwing path error but I have tried all the possible paths for my model. What is the correct path to the model? I have attached the error and code below for your reference. Any help is appreciated. Thanks a lot.
"message": "Kubernetes Deployment failed",
"message": "Error in entry script, FileNotFoundError: [Errno 2] No such file or directory: 'azureml-models/amlstudio-mlpredictionep01/1/sklearn_ml_exp', please run print(service.get_logs()) to get details."
Here is my score.py file:
model_path = os.path.join(os.getenv('AZUREML_MODEL_DIR'), 'sklearn_ml_exp')
model = joblib.load(model_path)
data = np.array(json.loads(raw_data)['data'])
y_hat = model.predict(data)
I registered the model with:
model = Model.register(workspace=ws,
model_path='outputs/prediction-model.pickle', # local path