ultralytics / yolov5

YOLOv5 πŸš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.45k stars 16.28k forks source link

Negative weights when using Macbook M1 with MPS #13387

Open guybashan opened 5 hours ago

guybashan commented 5 hours ago

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?

UltralyticsAssistant commented 5 hours ago

πŸ‘‹ 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 requirements.txt file, and that you're running on a compatible environment.

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