bowang-lab / MedSAM

Segment Anything in Medical Images
https://www.nature.com/articles/s41467-024-44824-z
Apache License 2.0
3.03k stars 419 forks source link

can medsam run on a macbook pro ? is there support for pytorch's mps backend ? #331

Open inventcures opened 1 month ago

inventcures commented 1 month ago

I followed the instructions on the github but am getting this error to run the included inferencing example "AssertionError: Torch not compiled with CUDA enabled"

Is there support in the medsam code for pytorch's MPS backend( Metal Performance Shaders), which is optimized for Apple's M-series GPUs ?

import torch

device = torch.device("mps") if torch.has_mps else torch.device("cpu")

model.to(device)
JunMa11 commented 1 week ago

Hi @inventcures ,

MedSAM doesn't support MAC but the lite MedSAM supports the Mac Pro.

https://github.com/bowang-lab/MedSAM/tree/LiteMedSAM