Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save willemnviljoen/3dbaedc2a243373bdf67f96fdd3f6bcf to your computer and use it in GitHub Desktop.
Save willemnviljoen/3dbaedc2a243373bdf67f96fdd3f6bcf to your computer and use it in GitHub Desktop.
If you are having trouble following along on an M1 Mac, it's because the versions of the packages included
in the environment for the course do not play nicely with ARM64 processors.
After much rending of shirts, I have come up with an environment which works.
To set it up, follow the steps below exactly:
1) If not already done, remove the existing `conda` environment you were using for the course, we have to rebuild it.
2) Remove any existing installation of Anaconda or Miniconda.
They use Rosetta2, and will not work with TensofFlow
(which is a dependency of Keras, which you need for the course), because TensorFlow has CPU optimisations which
Rosetta can't deal with.
3) Install Miniforge from here: https://github.com/conda-forge/miniforge
This replaces your command line `conda` with an ARM64-ready version, and has the added benefit of
making conda-forge the default channel.
4) Create an environmnt based on the below YAML:
```
name: apple_tensorflow
channels:
- conda-forge
- nodefaults
dependencies:
- python=3.8
- grpcio
- h5py
- ipython
- numpy=1.19.5
- pip=20.2.4
- scipy
- termcolor
- typeguard
- wheel
- absl-py
- astunparse
- python-flatbuffers
- gast
- google-pasta
- keras-preprocessing
- opt_einsum
- protobuf
- tensorboard
- tensorflow-estimator
- termcolor
- typing_extensions
- wrapt
- jupyter
- nltk
- pandas
- spacy
- jupyterlab
- matplotlib
- keras
- scikit-learn
- click=7.1.2
```
4) Install Apple opimised TensorFlow by running
```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/apple/tensorflow_macos/master/scripts/download_and_install.sh)"
```
5) Reload any Spacy languade models you may have had installed, these will probably do:
```
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_lg
```
Good luck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment