Skip to content

Silicon Mac GPU Support for training #13279

@oliver408i

Description

@oliver408i

Search before asking

Question

Hello. I have set up and trained my first model with Yolov5s (object detection) and I'm enjoying it so far. However, my training is quite slow on my macbook pro (m2 cpu/gpu). Logs says
YOLOv5 🚀 v7.0-358-gc07b9a8b Python-3.12.3 torch-2.4.0 CPU

I saw other posts regarding gpu acceleration on mac, but I didn't find any related to the training process. Currently, only my CPU is hitting <90% usage (total) while my GPU is pretty much idle. Training 30 epochs of a ~100 image dataset takes almost an hour. I used to use mediapipe and tflite, which trains the same dataset (30 epochs) in about 5 minutes. The train.py code only has options for cuda and cpu. I know that metal gpus is mps, but I'm not sure if I can just replace the device type with mps and call it a day.

Additional

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions