THU-MIG / yolov10

YOLOv10: Real-Time End-to-End Object Detection
https://arxiv.org/abs/2405.14458
GNU Affero General Public License v3.0
8k stars 662 forks source link

Macbook msu device on train gives error, if using cpu no error accured #305

Open 1Const1 opened 6 days ago

1Const1 commented 6 days ago
  Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size
   1/20         0G      2.888      30.52      4.322         22       1920: 100%|██████████| 300/300 [13:00<00:00,  2.60s/it]
             Class     Images  Instances      Box(P          R      mAP50  mAP50-95):   0%|          | 0/19 [00:00<?, ?it/s]/AppleInternal/Library/BuildRoots/91a344b1-f985-11ee-b563-fe8bc7981bff/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSNDArray/Kernels/MPSNDArrayGatherND.mm:256: failed assertion `Rank of updates array (1) must be greater than or equal to inner-most dimension of indices array (300)'

/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '

this error accrues on m3 mac device = "mps"


    model = YOLO("yolov10n.pt")  # load a pretrained model
device = "mps"
    model.train(data=file_path, epochs=20, batch=8, workers=8, device=device, augment=True, imgsz=1920)

if using device = "cpu" second stage didn't gives an error and train continue without any issues

env: Python 3.12.2 tourch 2.3.1 ultralytics 8.2.45

Is that any recommendations make it work on m3 mac under device = "mps"?