-
Notifications
You must be signed in to change notification settings - Fork 97
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 Mac compatibility #579
Comments
@ariematsliah-princeton any tips? |
No unfortunately I was not able to run SLEAP on m1. Even the pyside libraries can't be installed on mine. |
I guess M1 supports python versions of 3.8 or higher only, so 3.6 package is not supported currently. Would it be possible to use 3.8 or 3.9 for SLEAP? |
I wasn't able to make it work on 6 months old M1, but please give it a try and update if you've found a workaround. |
I tried my best to utilize M1 for the past few days with installation of SLEAP, yet still stuck with the python version. :( |
What happens when you try to I've been able to run it in Python 3.7 on Linux and Windows, but I think it should still be ok on 3.8. If not, let me know what kinds of error messages you're getting and we can try some stuff out from there. Cheers, Talmo |
For python versions of 3.6 and 3.7, I get (personal guess is that in order to run anaconda on M1 it has to go through alternatives like miniforge, and it seems the miniforge channel owns python of 3.8 and higher only) __PackagesNotFoundError: The following packages are not available from current channels:
Current channels:
To search for alternate channels that may provide the conda package you're
and use the search bar at the top of the page.__ In case of conda create -n sleap python=3.8 -y (I got hundreds of other error lines before the attached error but below seems to be the major one) _ERROR: Cannot install sleap==1.0.0, sleap==1.0.1, sleap==1.0.10, sleap==1.0.2, sleap==1.0.3, sleap==1.0.4, sleap==1.0.5, sleap==1.0.6, sleap==1.0.7, sleap==1.0.8, sleap==1.0.9, sleap==1.1.0, sleap==1.1.1, sleap==1.1.2, sleap==1.1.3, sleap==1.1.4 and sleap==1.1.5 because these package versions have conflicting dependencies. The conflict is caused by: To fix this you could try to:
Thanks for your attention and interest. Bests. |
Could you try the following? In the Python 3.8 environment (
Let me know if this doesn't work, or if it does, what version you end up getting (should be 5.15.2). Then, try to install sleap again like this:
And let me know what you get. There might be other version conflicts even if that does work, but let's just see -- there's a lot of stuff missing for M1 still so it's hard to know for sure which packages will work. |
Here are the errors from your previous advice. Thanks for your continued interest! (FYI, after every "in", "<n(m)odule>" should follow but they get ignored when I upload the comment.) anaconda3/envs/sleap/bin/sleap-label", line 5, in |
Just posting a small update to this issue -- we still haven't resolved it, but here's some additional troubleshooting we've been able to do in case someone else would like to pick it up from here:
The last line will probably break because many of our dependencies don't have binaries for M1. To troubleshoot this, start by relaxing the version requirements in
Things we've learned:
I'm still waiting on my M1 Mac to arrive so I can keep testing this, but I'd say it's safe to assume that there will not be an easy installation solution for M1 for a while. |
Big update: We can now run SLEAP on M1 Macs! Caveat: Network training is still not working (see the bottom of this post). Here are the steps if you want to use it today:
This might take a little while since it'll also install Xcode (which we'll need later). Once it's finished, run this to enable the
Then close and re-open the terminal again.
Note: This installs SLEAP in development mode, so changes to the source code are immediately applied in case you wanted to mess around with it. You can also just do a
Your Mac will then automatically sign a devil's pact with Apple to install the correct versions of everything on your system. Once the blood sacrifice/installation process completes, SLEAP will be available in an environment called
It takes a bit longer to start up than on Windows/Linux, but have faith :) Things that should work:
Neural network training, however, will NOT work. See below for where we're at with that. Currently, training on the GPU will not work (CPU works fine though, but slowly). Even in simple Unet models, we run into errors like this:
The important part is this:
Basically, it seems like Apple's tensorflow-metal can't run seem to find a way to place an operation in the Conv2D layer on the GPU. We'll need to dig into it a bit more to figure out what exact part of our models aren't working (maybe some poorly defined shapes or our preprocessing pipeline?). In the meantime, here are some other reports of similar issues to follow up on from other brave souls attempting to run TensorFlow on M1s: |
Update: Training is now working on M1! This means that SLEAP is now fully compatible with M1 macs! To use it, install it using the instructions listed in the post above. We'll try and streamline it for the 1.2.0 stable release. |
Status update: While both inference and training work on M1 now, the blocker is that we need to use PySide6 instead of PySide2 on M1 Macs. PySide6 does not have a conda package yet though, so we can't switch over completely since it would break support on Windows and Linux. Possible alternative: Support both PySide2 and PySide6 in the meantime, possibly without offering a conda-based installation route for PySide6. |
Just to keep track of the conda Qt6/PySide6 packaging, here's the relevant PR to follow: conda-forge/qt-main-feedstock#14 |
The m1 branch has been merged with main in the new release v1.2.7, but unfortunately the m1 conda package build has failed. We will follow up on the m1 conda build in a new issue. |
Hi! I followed the instructions on the SLEAP page for installing SLEAP, creating a new conda environment with Python 3.6 and installing sleap using pip. However, when I run sleap-label, I get the following error: "illegal hardware instruction sleap-label" I suspect this has something to do with the fact that I use an M1 MacBook Pro. Is anyone else running into this issue and if so, how were you able to resolve it?
Thanks for the help!
The text was updated successfully, but these errors were encountered: