facebookresearch / facebookresearch/sam2

How can SAM2 be used on Macs with Apple Silicon?

Open
#687 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
19.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I downloaded the repo and ran `SAM2_BUILD_CUDA=0 pip install -e .` but when I try using the following (super) minimal test script, it fails with `RuntimeError: Placeholder storage has not been allocated on MPS device!`. This is being caused by the last line of the example.

```
import torch
from sam2.build_sam import build_sam2
from sam2.sam2_image_predictor import SAM2ImagePredictor
```

https://github.com/facebookresearch/sam2/issues/122 says it supports MPS, but it doesn't work for me. What are the steps to get a minimal example of SAM2 running on a Mac? My Mac is an M4 if that matters.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.