-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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
Negative weights when using Macbook M1 with MPS #13387
Comments
👋 Hello @guybashan, thank you for reaching out and using YOLOv5 🚀! This is an automated response to confirm that we've received your issue. One of our Ultralytics engineers will assist you soon. It looks like you're encountering issues with negative weights while using YOLOv5 on a Macbook M1 with MPS. To help us investigate further, please make sure you've provided a minimum reproducible example of your issue. This will greatly assist our team in diagnosing and fixing the problem. To ensure the correct setup, confirm that you have Python version 3.8.0 or higher installed, along with all dependencies from the If you have any questions about your custom training setup, it would also be helpful to include dataset image examples, training logs, and verify if you're following best training practices. Additionally, we're excited to let you know about YOLOv8, our latest state-of-the-art object detection model designed for enhanced performance, accuracy, and usability. Stay tuned for updates and enhancements! 🚀✨ Thank you for your patience and contribution to the YOLOv5 community! 😊 |
@guybashan thank you for reporting this issue. Please ensure that your PyTorch version supports MPS on Mac M1 and try updating to the latest version if you haven't already. If the problem persists, consider running the training on a different device to isolate the issue. |
@pderrenger thanks for your respond. |
@guybashan it seems like the issue might be specific to MPS execution. I recommend checking for any known issues with PyTorch MPS support or trying a different PyTorch version that might resolve this discrepancy. |
Search before asking
YOLOv5 Component
Detection
Bug
Hi,
Indeed I am using the latest code from git (main branch).
I re-run the training using this:
/cam-analyzer/pytorch_metal_env/bin/python ../yolov5/train.py --img 416 --batch 16 --epochs 100 --data ../yolo_cfg/data.yaml --weights yolov5m.pt --device mps
I re-checked my "train" and "val" folders. They look ok and the files look fine. I created the labels using YoloLabel app (open source).
I run the detection using this command:
/cam-analyzer/pytorch_metal_env/bin/python detect.py --save-txt --save-conf --weights /Users/user/Documents/dev/yolo_model/cam_analyzer/weights/best.pt --source /Users/user/Documents/dev/yolo_images --conf 0.1 --project /Users/columbo/Documents/dev/yolo_results --name detections --device mps
I use M1 Max with 64GB memory
I enabled working with GPU
Environment
Minimal Reproducible Example
/cam-analyzer/pytorch_metal_env/bin/python detect.py --save-txt --save-conf --weights /Users/user/Documents/dev/yolo_model/cam_analyzer/weights/best.pt --source /Users/user/Documents/dev/yolo_images --conf 0.1 --project /Users/columbo/Documents/dev/yolo_results --name detections --device mps
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: