-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble running mask generation on M1 Max #129
Comments
Hello @mary-mark - the code here has been specialized for GPUs, so I haven't tried it for mps yet. It's likely that you need to make some changes to have this work. Do you have the full stacktrace of the error? |
Thanks for the reply @cpuhrsch. Here is the error: |
Oh interesting. Can you try setting |
That seemed to work, but now I get the MPS float32 error:
I've tried to cast as float32 in autonatic_mask_generator.py line 288 (in_points = torch.as_tensor(transformed_points.astype(np.float32)) , as it worked for me when using segment_anything, but I get the following error:
Is there another place where I can specify to use float32? |
Ok thanks for trying. Hm, could you post the full stack trace again please and send a branch with your changes? |
This is the trace for float64 error: This is the trace for when I cast to float32, which is the version on this fork https://github.com/mary-mark/segment-anything-fast.git :
|
Ok, I see. Right, so this will require NestedTensors to work on M1 Max. You'd have to turn off more and more performance features of segment-anything-fast to get this to work on M1 Max. I'm not sure this project will be useful to you after turning all of that off. We really focus on GPUs within this repository. |
Hi there,
I am trying to run SamAutomaticMaskGenerator using device = 'mps' but I am getting the following error:
RuntimeError: Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0". This is no longer allowed; the devices must match.
I also tried to use device = 'cpu' but the same error appears. Is it possible to run this on M1 Max, and if so how could I fix this error?
The text was updated successfully, but these errors were encountered: