Skip to content

Instantly share code, notes, and snippets.

@cfox570
Last active July 17, 2023 18:22
Show Gist options
  • Save cfox570/e89603392fd48e1a60ef2f1c667e2050 to your computer and use it in GitHub Desktop.
Save cfox570/e89603392fd48e1a60ef2f1c667e2050 to your computer and use it in GitHub Desktop.
Install Donkeycar on Mac M1 or M2 osx-arm64

If you have a previous installation, it is recommended that you remove all of the files including miniconda, donkeycar and micromamba folders. You should also remove miniconda, micromamba edits in the terminal startup scripts .zshrc and .bash_profile

Step 1: Install Micromamba and git

launch terminal and start in your home directory cd ~

Install Homebrew - see https://brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git 

Download and and install Micromamba

"${SHELL}" <(curl -L micro.mamba.pm/install.sh)
echo $'channels:\n -conda-forge\nalways_yes:false' >>.mambarc

The following command will activate micromamba. If micromamba command fails to work, close the terminal session and open a new one.

source ~/.zshrc
micromamba self-update 

Step 2: Get Donkeycar from Github

mkdir projects
cd projects
git clone https://github.com/autorope/donkeycar
cd donkeycar
git checkout main

Step 3: Setup Virtual Env for Donkey

micromamba env create -f install/envs/mac-arm64.yml
micromamba activate donkey
pip install -e .\[pc\]

Note that this installation will use the builtin M1/2 GPU to speedup tensorflow.

Step 4: Create Mycar folder

donkey createcar --path ~/mycar
mkdir ~/mycar/parts

Training

date; donkey train --tub data/ --model models/2023-3arch64.h5 --type linear --framework tensorflow; date
name: donkey
channels:
- defaults
- conda-forge
- pytorch
- fastai
- apple
dependencies:
- python=3.9
- numpy
- h5py
- pillow
- opencv
- matplotlib
- tornado
- docopt
- pandas
- pylint
- pytest
- pytest-cov
- codecov
- pip
- progress
- paho-mqtt
- PrettyTable
- pyfiglet
- mypy
- pytorch
- torchvision
- torchaudio
- pytorch-lightning>=1.9,<2.0
- psutil
- plotly
- pyyaml
- fastai
- pynmea2
- pyserial
- utm
- albumentations
- tensorflow-deps
- pip:
- kivy==2.1
- tensorflow-macos==2.9.2
- tensorflow-metal==0.5.1
- git+https://github.com/autorope/keras-vis.git
- simple-pid
- moviepy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment