MaskRCNN not serving when using PyTorchServe Docker
See original GitHub issueSteps which led me to the bug
- I downloaded PyTorch Serve Docker image from here --> https://hub.docker.com/r/pytorch/torchserve
- Downloaded https://download.pytorch.org/models/maskrcnn_resnet50_fpn_coco-bf2d0c1e.pth to my computer in folder C:/examples
- Downloaded https://github.com/pytorch/serve/tree/master/examples/ to my computer in folder C:/examples
- Created empty folder called model-store here --> C:/model-store
- Run the command
docker run -it -p 8080:8080 -p 8081:8081 --name mar -v C:/model-store:/home/model-server/model-store -v C:/examples:/home/model-server/examples pytorch/torchserve:latest - Run the command
docker exec -it <container_name> /bin/bash - From inside the container bash
torch-model-archiver --force --model-name maskrcnn --version 1.0 --model-file /home/model-server/examples/object_detector/maskrcnn/model.py --serialized-file /home/model-server/examples/maskrcnn_resnet50_fpn_coco-bf2d0c1e.pth --handler object_detector --export-path /home/model-server/model-store --extra-files /home/model-server/examples/object_detector/index_to_name.json - From inside the container bash
torchserve --start --model-store /home/model-server/model-store --models maskrcnn=maskrcnn.mar - Download persons.jpg to my desktop from here --> https://github.com/pytorch/serve/tree/master/examples/object_detector/maskrcnn
- From my desktop (host machine)
curl http://127.0.0.1:8080/predictions/maskrcnn -T persons.jpg - I am getting the following error
{ "code": 404, "type": "ModelNotFoundException", "message": "Model not found: maskrcnn" }
Note :- I followed the same steps for Densenet image classifier (from the examples from the repo) and it worked perfectly fine. MaskRCNN doesn’t work however
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Min requirements for torchserve - deployment - PyTorch Forums
What is the min requirements for deploying torchserve? My current system isnt low spec but seems to be hanging every time i up...
Read more >Model Deployment using TorchServe | by Kaustav Mandal
TorchServe is a framework for serving pyTorch trained models in a seamless, performant manner. In this tutorial, we will walk though the steps...
Read more >Log Analysis — MMDetection 2.26.0 documentation
3. Run mmdet-serve ¶. Check the official docs for running TorchServe with docker. In order to run in GPU, you need to install...
Read more >Accelerating Inference Up to 6x Faster in PyTorch with Torch ...
A Linux machine with an NVIDIA GPU, compute architecture 7 or earlier; Docker installed, 19.03 or later; A Docker container with PyTorch, Torch- ......
Read more >[WIP] Documentation fixes and enhancements (#584) (bacdf0a6 ...
This section shows a simple example of serving a model with TorchServe. To complete this example, ... Refer https://github.com/pytorch/serve/docker or ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A good place to debug would be to do a list model to confirm that the model has been registered.
curl -X GET http://127.0.0.1:8081/modelsshould tell you if the model is registered.@alvarobartt I had to redownload the image and it worked !!!
Attaching all the steps that worked for me. Thanks a lot !!!