-
Notifications
You must be signed in to change notification settings - Fork 830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using torch_hub_yolov5 Custom Mode #2860
Comments
@darkking-park does it work if you run |
@parano if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Flask api exposing yolov5 model")
parser.add_argument("--port", default=5000, type=int, help="port number")
args = parser.parse_args()
model = torch.hub.load("ultralytics/yolov5", "custom", path='./model/best.pt', force_reload=True, autoshape=True)
model.eval()
app.run(host="0.0.0.0", port=args.port) I want to use bento rather than flask |
@darkking-park were you able to run the example with a brand new torch hub model downloaded from the git repo? Where did you put the |
were you able to run the example with a brand new torch hub model downloaded from the git repo?https://github.com/ultralytics/yolov5 Where did you put the 'my_custom_yolov5_model.pt file? is it under the same directory?A model exists in the path set in torch.hub.load. path='./model/best.pt' |
@darkking-park it seems to me it's an issue with torchhub local cache or an issue with the model path and project path. It would be helpful if you could try setup everything from scratch and share us steps to reproduce, or I'd be happy to hop on a zoom call to help with debugging the issue, feel free to ping me in our slack channel if you'd like to do that. |
Describe the bug
I inquired about the issue before ==> #2602
First of all, thank you so much for answering my inquiry and giving me a solution. https://github.com/bentoml/gallery/tree/main/custom_runner/torch_hub_yolov5
So I implemented your proposal.
I checked that it went normally if I did as you suggested.
But Error occurs when running with custom model.
I only changed the following from your service.py source.
service .py
Error occurs when using custom model as follows.
Please review the error
For your information, I confirmed that my model(my_custom_yolov5_model.pt) is serving normally with flask.
To reproduce
Same as the guide
https://github.com/bentoml/gallery/tree/main/custom_runner/torch_hub_yolov5
Expected behavior
Same as the guide
https://github.com/bentoml/gallery/tree/main/custom_runner/torch_hub_yolov5
Environment
Same as the guide
https://github.com/bentoml/gallery/tree/main/custom_runner/torch_hub_yolov5
The text was updated successfully, but these errors were encountered: