Closed yogendra-yatnalkar closed 9 months ago
Hi, can you please check your 0.png file? Did you by any chance curl/wget that from github? Because that json you see in your handler looks pretty much identical to the one you get when you curl -o 0.png https://github.com/pytorch/serve/blob/master/examples/image_classifier/mnist/test_data/0.png
You need to use the raw file link when downloading files from github through curl/wget:
Hi @mreso, you are right. Thanks for pointing out my mistake. I was load-testing with torchserve using image which I just curled from github. Now I created a blank image using numpy directly and it has started working now. Thanks for the support.
I team, I have created my own custom handler by referencing to the base-handler and the vision-handler. What I am observing is that, when I pass data to the model for inference, the data is not reaching to the hosted model endpoint.
The exact error I am getting is:
When I printed my "data" before passing it for preprocessing, this is what I got:
As you can see, there is no "data" key in the above json object which actually has my base64 image or any byte-array.
I tried passing my data two ways:
using curl as shown in documentation:
Or using python requests as below:
I have initially played with the default mnist example, and it worked without any hiccups. My custom-handler code is as follows:
Can you please help me here. Thanks in advance.