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

Multiple detections when using mps #9601

Closed
1 of 2 tasks
lightonthefloor opened this issue Sep 26, 2022 · 10 comments
Closed
1 of 2 tasks

Multiple detections when using mps #9601

lightonthefloor opened this issue Sep 26, 2022 · 10 comments
Labels
bug Something isn't working Stale

Comments

@lightonthefloor
Copy link

Search before asking

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

YOLOv5 Component

No response

Bug

When running on --source 0, there are multiple detections.
Uploading 截屏2022-09-26 20.48.03.png…

Environment

  • python 3.10.4
  • torch-1.13.0.dev20220926 MPS
  • command is PYTORCH_ENABLE_MPS_FALLBACK=1 python detect.py --device mps --source 0 --weights yolov5m6.pt

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@lightonthefloor lightonthefloor added the bug Something isn't working label Sep 26, 2022
@lightonthefloor
Copy link
Author

截屏2022-09-26 20 48 03

@glenn-jocher
Copy link
Member

@lightonthefloor you don't need any fallback, normal inference command runs, but yes the MPS model is differing from the CPU model. There may some MPS issue here.

You should put breakpoints in the model to debug where the differences start. This may be an issue that needs to be raised with the torch team if you can isolate the cause of the difference.

Screenshot 2022-09-26 at 14 52 56

@lightonthefloor
Copy link
Author

Oops, and my detections of demo is right.
bus

@glenn-jocher
Copy link
Member

@lightonthefloor are you sure? I get incorrect results on MPS, even though MPS inference runs without error.

Screenshot 2022-09-26 at 15 02 42

@lightonthefloor
Copy link
Author

Sorry, I check again. I get the correct answer when I run on cpu.

@glenn-jocher
Copy link
Member

I tested PYTORCH_ENABLE_MPS_FALLBACK=1 classify/predict.py, and this works correctly, so it seems perhaps an issue with Detect(), maybe grids that MPS is not converting correctly.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2022

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale label Oct 27, 2022
@ehallein
Copy link

ehallein commented Oct 29, 2022

FYI another detector https://github.com/microsoft/CameraTraps which uses YOLOv5 works on MPS with GPU acceleration with no issues, so it appears detect.py may be the issue, not PyTorch.

See here microsoft/CameraTraps#297

@github-actions github-actions bot removed the Stale label Oct 30, 2022
@jgoo9410
Copy link

Also having this issue, was any progress made in finding the cause @lightonthefloor?

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2022

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale label Dec 17, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

4 participants