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

Tensorrt model inference not working on folder of images and videos #9578

Closed
1 of 2 tasks
vardanagarwal opened this issue Sep 25, 2022 · 2 comments · Fixed by #9581
Closed
1 of 2 tasks

Tensorrt model inference not working on folder of images and videos #9578

vardanagarwal opened this issue Sep 25, 2022 · 2 comments · Fixed by #9581
Labels
bug Something isn't working

Comments

@vardanagarwal
Copy link
Contributor

Search before asking

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

YOLOv5 Component

Detection

Bug

Running the default commands in the given colab notebook. Successful in creating a Tensorrt model but unable to run detect.py.

Screenshot from 2022-09-25 17-45-46

The same issue is faced on a folder of videos, however works on a single video.

Environment

No response

Minimal Reproducible Example

python3 detect.py --weights yolov5s.engine --imgsz 640 --device 0  # inference

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@vardanagarwal vardanagarwal added the bug Something isn't working label Sep 25, 2022
@glenn-jocher
Copy link
Member

glenn-jocher commented Sep 25, 2022

@vardanagarwal 👋 hi, thanks for letting us know about this possible problem with YOLOv5 🚀. I've run the code below and am able to reproduce the same issue you are seeing. I'll add a TODO and prioritize a fix for this.

# TensorRT 
!pip install -U nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com  # install
!python export.py --weights yolov5s.pt --include engine --imgsz 640 --device 0  # export
!python detect.py --weights yolov5s.engine --imgsz 640 --device 0  # inference

@glenn-jocher
Copy link
Member

@vardanagarwal good news 😃! Your original issue may now be fixed ✅ in PR #9581. I've also added exported model inference to our CI to catch this type of error earlier in the future.

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 🚀!

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