-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
The operator 'aten::nonzero' is not currently supported on the MPS backend #8508
Comments
@abhimanyuchadha96 thanks for the bug report! This is interesting, are you running on Apple M1 hardware? |
@abhimanyuchadha96 have you tried setting environment variable |
Yes, I have a Mac Studio which has the M1 Ultra Chip. |
@glenn-jocher where should I set up that flag though? I couldn't find the exact place. |
i.e. to set environment variable before running detect.py just do this:
|
@abhimanyuchadha96 I don't have access to M1 hardware today, but you could debug this a bit to see if there's some alternative indexing implementation that works. If you find a solution please let us know or also submit a PR to help future users. The indexing is right here on L820 that is causing the error. Lines 800 to 821 in 27d831b
|
@abhimanyuchadha96 left a comment in pytorch/pytorch#77764 |
@abhimanyuchadha96 well then you might just want to move the predictions to CPU at the beginning of the NMS function. |
@glenn-jocher While it did run successfully after doing that, the results that were saved were blank ie without any bounding boxes. Even with the confidence as low as 0.01 |
@abhimanyuchadha96 I tried this here on GPU and it seems to work well. If MPS isn't working I'm not sure what the problem is, but I'll stick a TODO here to investigate. |
Any updates on this? I am getting the same error on the Stable version 1.13.1 |
Any updates? on UserWarning: The operator 'aten::nonzero' is not currently supported on the MPS backend?? |
Any updates on this? I have got the same error on my M2 device, but I can run it through the CPU. |
@Chi-XU-Sean thanks for bringing this to our attention. We understand that you are experiencing an issue with the 'aten::nonzero' operator not being supported on the MPS backend, specifically on your M2 device. At the moment, we don't have any specific updates on this issue. However, we recommend trying to run the code through the CPU as a workaround, if that is working for you. Please note that the YOLOv5 repo is maintained by volunteers and the Ultralytics team, and we rely on community contributions and feedback to address issues and improve the codebase. Therefore, any further contributions or insights from the community on this issue would be greatly appreciated. If you have any further questions or need additional assistance, please don't hesitate to ask. Thank you for your patience and support! |
Search before asking
YOLOv5 Component
Detection
Bug
Environment
No response
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: