Skip to content
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

Torchscript file is not working with detect.py #6000

Closed
2 tasks done
RizwanMunawar opened this issue Dec 16, 2021 · 3 comments · Fixed by #6007
Closed
2 tasks done

Torchscript file is not working with detect.py #6000

RizwanMunawar opened this issue Dec 16, 2021 · 3 comments · Fixed by #6007
Labels
bug Something isn't working

Comments

@RizwanMunawar
Copy link
Member

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

Detection

Bug

Below, command is throwing error, when I am detecting with torchscript file.
python .\detect.py --weights "B:\yolov5-master\yolov5s.torchscript" --source "B:\Testing videos\test.avi"

Screenshot 2021-12-16 111722
,

Environment

Windows 10
Python 3.7
yolov5 latest release

Minimal Reproducible Example

python .\detect.py --weights "B:\yolov5-master\yolov5s.torchscript" --source "B:\Testing videos\test.avi"

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@RizwanMunawar RizwanMunawar added the bug Something isn't working label Dec 16, 2021
@glenn-jocher
Copy link
Member

@RizwanMunawar thanks for the bug report! I am able to reproduce this problem. I'll add a TODO to investigate today.

!python export.py --weights yolov5s.pt --include torchscript
!python detect.py --weights yolov5s.torchscript

@glenn-jocher
Copy link
Member

@RizwanMunawar good news 😃! Your original issue may now be fixed ✅ in PR #6007. To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

@RizwanMunawar
Copy link
Member Author

Cool, it works fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants