facebookresearch / facebookresearch/segment-anything
Segmentation error on MPS device
- Dominant language
- Jupyter Notebook
- Stars
- 54.9k
- Forks
- 6.4k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I was doing some tests with CT images and while using the vit_h model on mps in my macbook pro it gives me the following strange result.

On the same macbook I tested on cpu and it gave a very different and more meaningful result, the same result that I had on my desktop with cuda.

Is there some problem with pytorch on MPS?
Contributor guide
Research direction
The report names CT images, the vit_h model, and MPS, CPU, and CUDA execution but no source file or test. Reproduce the inference on MPS and compare it with CPU output, then investigate whether the discrepancy is in Segment Anything or PyTorch's MPS support; done means a documented cause or a minimal reproducible finding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, macos
- Domain
- computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100