segment-anything icon indicating copy to clipboard operation
segment-anything copied to clipboard

error, macOS, AssertionError: Torch not compiled with CUDA enabled

Open jk2K opened this issue 2 years ago • 1 comments

step to reproduce

python scripts/amg.py --checkpoint "/Users/aa/Downloads/sam_vit_b_01ec64.pth" --model-type "vit_b" --input "/Users/aa/Downloads/saas-screenshot/SCR-20231005-pziz.png" --output "/Users/aa/Downloads/saas-screenshot/output/1.png"

info

macOS M1 version: 13.5.1

jk2K avatar Nov 03 '23 10:11 jk2K

I encountered that problem on macOS M1 and was able to get past it by adding --device cpu. Please note that is very slow and there are other GitHub issues about how to use a faster device such as mps: https://github.com/facebookresearch/segment-anything/issues/94

samreid avatar Nov 28 '23 03:11 samreid