pytorch / serve

Serve, optimize and scale PyTorch models in production
https://pytorch.org/serve/
Apache License 2.0
4.19k stars 858 forks source link

Invalid return type: <class 'numpy.ndarray'>. #526

Closed buqing2009 closed 4 years ago

buqing2009 commented 4 years ago

When I post process the inference output in handler, it seems that it only support return list object. But some model of other tasks like depth estimation, sceneflow, 3D reconstruction..., the output is just a image. It's necessary for torch serve to response the client request, and return an image url.

harshbafna commented 4 years ago

@buqing2009: You could return the binary data for the image generated by your model and write it to a file at the client end.

You can refer the following examples :

buqing2009 commented 4 years ago

thanks, it's helpful

sevenold commented 4 years ago

for example, the text detection(CTPN, CRAFT, EAST...) model output a lot of images. How should I use other default return methods in my custom handler. [{},{}],[[[]]] not only [] Thanks. @harshbafna