While following the tutorial 'Creating a custom serving runtime in KServe ModelMesh' from the IBM site, I was trying to make a small adjustment, loading the sklearn mnist-svm.joblib model from the localMinIO instead. However, it failed to load the model and returned the error message MLServer Adapter.MLServer Adapter Server.LoadModel MLServer failed to load model {"modelId": "multi-model-isvc__isvc-1ee2e56a33", "error": "rpc error: code = NotFound desc = Model multi-model-isvc__isvc-1ee2e56a33 not found"}.
I was wondering if it is a bug or if there are any mistakes that I have made on the configuration. Please give me any advice and let me know if any further details you need. Really appreciated.
To Reproduce
Steps to reproduce the behavior:
Install ModelMesh Serving in the local minikube following the instruction
Create Custom ML Model, code as below.
from mlserver.model import MLModel
from mlserver.utils import get_model_uri
from mlserver.errors import InferenceError
from mlserver.codecs import DecodedParameterName
from mlserver.types import (
InferenceRequest,
InferenceResponse,
ResponseOutput,
)
import logging
from joblib import load
import numpy as np
Describe the bug
While following the tutorial 'Creating a custom serving runtime in KServe ModelMesh' from the IBM site, I was trying to make a small adjustment, loading the sklearn mnist-svm.joblib model from the localMinIO instead. However, it failed to load the model and returned the error message
MLServer Adapter.MLServer Adapter Server.LoadModel MLServer failed to load model {"modelId": "multi-model-isvc__isvc-1ee2e56a33", "error": "rpc error: code = NotFound desc = Model multi-model-isvc__isvc-1ee2e56a33 not found"}
.I was wondering if it is a bug or if there are any mistakes that I have made on the configuration. Please give me any advice and let me know if any further details you need. Really appreciated.
To Reproduce Steps to reproduce the behavior:
from os.path import exists
logging.basicConfig(level=logging.INFO) logger = logging.getLogger(name)
_to_exclude = { "parameters": {DecodedParameterName, "headers"}, 'inputs': {"all": {"parameters": {DecodedParameterName, "headers"}}} }
WELLKNOWN_MODEL_FILENAMES = ["mnist-svm.joblib"]
class CustomMLModel(MLModel):
async def load(self) -> bool: model_uri = await get_model_uri( self._settings, wellknown_filenames=WELLKNOWN_MODEL_FILENAMES ) logging.info("Model load URI: {model_uri}")
async def predict(self, payload: InferenceRequest) -> InferenceResponse: input_data = [input_data.data for input_data in payload.inputs] input_name = [input_data.name for input_data in payload.inputs] input_data_array = np.array(input_data) result = self._model.predict(input_data_array) predictions = np.array(result)
Expected behavior
Usually, it should have loaded the model successfully.
Screenshots
However, it shows the logs as below.
Environment (please complete the following information):
Additional context