1

I have started learning MLflow recently and I am trying out ML life cycle on a simple cat-dog classifier. Here is the code.

I have correctly set up the model for serving using mlflow serve. However, there is one problem. I have configured the model signature to take a specific shape of input and the API endpoint will take an array when sending a request.

In the send_request.py file I am performing preprocessing for CNN input and then sending the Numpy array as a list. What I would like to do is, set up my own custom predict function for the model. So that the endpoint will only take a raw image as an input instead of an array.

I followed this tutorial. But couldn't make it work for my case.

I understand that while logging/saving the model, I'll need to provide custom objects. But I am not sure how to obtain the object of the model that performs the prediction inside these custom models. There aren't many resources to refer to for this particular case.

0 Answers0