segment-anything
segment-anything copied to clipboard
error, macOS, AssertionError: Torch not compiled with CUDA enabled
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
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