ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
51.2k stars 16.43k forks source link

Torchscript file is not working with detect.py #6000

Closed RizwanMunawar closed 2 years ago

RizwanMunawar commented 2 years ago

Search before asking

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?

glenn-jocher commented 2 years ago

@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 commented 2 years ago

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

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 commented 2 years ago

Cool, it works fine now.