-
Notifications
You must be signed in to change notification settings - Fork 376
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
M1 apple #523
Comments
It’s because apple is not using nvidia gpu. |
This recently came up on the image.sc forums. |
thanks @psobolewskiPhD , we'll be happy to take a pull request on this. I don't have an M1 mac to test myself |
…forcing tiff saving for masks > 2**16 (#524), and new suggestion mode
Hi @carsen-stringer, I'm able to make PyTorch utilize the M1 apple chip. The trick is to install the PyTorch from nightly builds: However, this is not enough for cellpose to utilize the M1 chip. As far as I see from the cellpose's The lazy solution for the Apple M1 users is to do the following change in all relevant places: |
Thank you so much for your responses.
It was possible to run Cellpose locally and in GUI, and I got results as well, but I am wondering how the TORCH.CUDA package is going to affect training models and predicting results?
…________________________________
From: carsen-stringer ***@***.***>
Sent: Sunday, July 3, 2022 9:03 AM
To: MouseLand/cellpose ***@***.***>
Cc: Zahra Yazdani Najafabadi ***@***.***>; Author ***@***.***>
Subject: Re: [MouseLand/cellpose] M1 apple (Issue #523)
thanks @psobolewskiPhD<https://github.com/psobolewskiPhD> , we'll be happy to take a pull request on this. I don't have an M1 mac to test myself
—
Reply to this email directly, view it on GitHub<#523 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARHSQ6XY4AFEYOPEQH4SDLTVSGFRJANCNFSM5X4D723A>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
this is now possible from the command line with please let me know if this works and I'll add it to the GUI |
I was able to get the '--gpu_device mps' option to work locally off the command line on an macbook air M2 (!) |
Upon closer inspection this does not appear to be working for me. My torch installation is working and able to access the mps through First, when I run on the command line it appears to load the GPU but then revert back to CPU and I am not getting any performance increase upon using
Then, when I try to run from a python script I get an error while trying to load a model:
and here is the error:
but if I make the same call like this:
Not sure if I am making some silly mistake or not but would be great if anyone has insight on this. |
I ran into the same problem here (running Cellpose 2.1.1 on a M1 Pro). I think this is because the function Line 81 in 377cb69
This way if 'mps' is passed as 'device' parameter, we can avoid executing the code block in the if statement below (the As for the runtime error you get when using cellpose from a script, I think it's an issue with the cellpose/cellpose/resnet_torch.py Line 220 in 377cb69
I think now you should be able to pass the argument Any one else got cellpose to run on M1 gpu? |
forgot to mention that I'm running pytorch 1.13.0 |
@delnatan If you want to try, I have a branch where I hacked in MPS support. |
I think this should be working on the main branch now, please feel free to make a pull request if I'm missing something in the implementation |
What about from a notebook/script? |
Hello,
I trained a model in GUI (Cellpose-V2) and I'd like to use it on a pipeline in the Jupyter notebook.
I'm facing this error: TORCH CUDA version not installed/working.
I used
conda install pytorch cudatoolkit=10.1 -c pytorch
but it didn't work.Would you please help me to fix this issue?
I have a MacBook air M1
The text was updated successfully, but these errors were encountered: