Skip to content

Conversation

@MMathisLab
Copy link
Member

Based on issue #1380, and in particular comment #1380 (comment), here is a DLC environment that works on M1 chips (freshly acquired - today - macbook pro was used for testing that had High Sierra installed).

Use this (DEEPLABCUT_M1.yaml) conda file if you have an M1, and follow these steps:

DeepLabCut M1 chip installation environment instructions (assuming you have anaconda installed!):

(1) git clone the deeplabcut cut repo:

git clone https://github.com/DeepLabCut/DeepLabCut.git

(2) in the program terminal, cd DeepLabCut/conda-environments

(3) Click here to download the Rosetta wheel for TensorFlow 2.4.1:
https://drive.google.com/file/d/17pSwfoNuyf3YR8vCaVggHeI-pMQ3xL7l/view?usp=sharing

(4) Then, run:

conda env create -f DEEPLABCUT_M1.yaml

(5) Next, activate the environment, and in the terminal cd to Downloads, and then run:

pip install tensorflow-2.4.1-py3-none-any.whl --no-dependencies --force-reinstall

(6) Next, launch DLC with pythonw -m deeplabcut

GUI will open!

@MMathisLab MMathisLab requested a review from jeylau July 22, 2021 13:38
@MMathisLab MMathisLab added documentation documentation updates/comments enhancement New feature or request labels Jul 22, 2021
@Benthealchemist
Copy link

Thanks to the team for this quick fix! DLC works now without a hitch on my Air M1 (2020).

@AlexEMG AlexEMG requested review from AlexEMG and removed request for jeylau July 25, 2021 10:17
@AlexEMG AlexEMG self-assigned this Jul 25, 2021
more general TF version comment
@AlexEMG AlexEMG merged commit 3e28524 into master Jul 25, 2021
@AlexEMG
Copy link
Member

AlexEMG commented Jul 25, 2021

I should also say, tested this on my Pro book. Thanks!

@outlace
Copy link

outlace commented Jul 25, 2021

@jeylau jeylau deleted the M1 branch July 26, 2021 12:03
@neurologic
Copy link

This also fixed the issue I was trying to solve today on a non-M1chip mac (Mac OS Catalina; Intel Core i7). It seems like there is no pythonw for python3.8 so whenever I ran pythonw it was using my 'native' usr/bin/ pythonw. I could not figure out how to get pythonw for python3.8 (tried too many things to list and none of them ended up fruitful). Whatever magic is happening in this M1chip environment solved this issue. Obviously(?) it is because the M1 environment has python3.7? I had tried downgrading to 3.7 in the DEEPLABCUT environment and that alone failed for obvious reasons....
Anyway. I am rambling now a bit.
But wanted to add this use case for which it helped solve my issue of not being able to use pythonw on my Mac even though it is a 'traditional' mac build.

@BearConnorsParadiso
Copy link

BearConnorsParadiso commented Sep 3, 2021

Thanks for your updates on M1. Sadly, I am still facing some errors while installing. I am currently using miniforge to run anaconda fyi. Below are the errors.

conda env create -f DEEPLABCUT_M1.yaml induces ResolvePackageNotFOund: - python=3.7.

So once I edit the .yaml file to change python=3.7 to python=3.8 then it seems to work, however, at the stage of pip install, ultimately the terminal shows

**WARNING: Discarding https://files.pythonhosted.org/packages/ec/ed/46b835da53b7ed05bd4c6cae293f13ec26e877d2e490a53a709915a9dcb7/matplotlib-2.2.2.tar.gz#sha256=4dc7ef528aad21f22be85e95725234c5178c0f938e2228ca76640e5e84d8cde8 (from https://pypi.org/simple/matplotlib/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: deeplabcut 2.0.1 does not provide the extra 'gui'
WARNING: deeplabcut 2.0.0 does not provide the extra 'gui'
ERROR: Cannot install deeplabcut[gui]==2.0.0, deeplabcut[gui]==2.0.1, deeplabcut[gui]==2.0.2, deeplabcut[gui]==2.0.3, deeplabcut[gui]==2.0.4, deeplabcut[gui]==2.0.4.1, deeplabcut[gui]==2.0.5, deeplabcut[gui]==2.0.5.1, deeplabcut[gui]==2.0.6, deeplabcut[gui]==2.0.6.2, deeplabcut[gui]==2.0.6.3, deeplabcut[gui]==2.0.7, deeplabcut[gui]==2.0.7.1, deeplabcut[gui]==2.0.7.2, deeplabcut[gui]==2.0.8, deeplabcut[gui]==2.0.9, deeplabcut[gui]==2.1, deeplabcut[gui]==2.1.1, deeplabcut[gui]==2.1.10, deeplabcut[gui]==2.1.10.1, deeplabcut[gui]==2.1.10.2, deeplabcut[gui]==2.1.10.3, deeplabcut[gui]==2.1.10.4, deeplabcut[gui]==2.1.2, deeplabcut[gui]==2.1.3, deeplabcut[gui]==2.1.4, deeplabcut[gui]==2.1.5, deeplabcut[gui]==2.1.5.1, deeplabcut[gui]==2.1.5.2, deeplabcut[gui]==2.1.6, deeplabcut[gui]==2.1.6.1, deeplabcut[gui]==2.1.6.2, deeplabcut[gui]==2.1.6.3, deeplabcut[gui]==2.1.6.4, deeplabcut[gui]==2.1.7, deeplabcut[gui]==2.1.7.1, deeplabcut[gui]==2.1.8, deeplabcut[gui]==2.1.8.1, deeplabcut[gui]==2.1.8.2, deeplabcut[gui]==2.1.9, deeplabcut[gui]==2.1.9.1, deeplabcut[gui]==2.2 and deeplabcut[gui]==2.2.0.1 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

failed

CondaEnvException: Pip failed**

Anyone could help with this? Thank you in advance.

@MMathisLab
Copy link
Member Author

3.8 won't work for the M1 due to dependency issues; you will have to use 3.7; is there a reason you don't have 3.7 installed? I recommend installing anaconda and trying again! I can def. confirm it works on our M1 chip Macs from early to late 2021.

@BearConnorsParadiso
Copy link

Successfully installed by launching terminal from the anaconda navigator.

Launching terminal program directly from the desktop had 'miniforge' environment as a default, which does not support python 3.7.

Thanks!

Bests,

@MMathisLab
Copy link
Member Author

super - glad to hear :) enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation documentation updates/comments enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants