-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacos-arm-setup.sh
38 lines (28 loc) · 1.29 KB
/
macos-arm-setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
minicondaPath="$HOME/miniconda"
tensorflow-macos=2.9.0
tensorflow-metal=0.5.0
function echo.blue(){
echo -e "\033[1;34m$*\033[0m"
}
echo.blue "installing tensorflow macos arm miniconda in $minicondaPath"
upgrade=""
if [[ -d $minicondaPath ]] ; then
echo.blue "$minicondaPath detected, upgrading"
upgrade="-u"
fi
#https://developer.apple.com/metal/tensorflow-plugin/
echo.blue "download and execute miniconda setup for macos arm"
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o "miniconda_setup_patate.sh" || exit 3
bash miniconda_setup_patate.sh -b $upgrade -p "$minicondaPath" || exit 4
rm miniconda_setup_patate.sh
echo.blue "activate conda environment"
source "$minicondaPath/bin/activate" || exit 5
echo.blue "conda install tensorflow-deps"
conda install -y -c apple tensorflow-deps
echo.blue "pip install tensorflow-macos"
python -m pip install --force-reinstall tensorflow-macos=="${tensorflow-macos}" --no-input | { grep -v "already satisfied" || :; }
echo.blue "pip install tensorflow-metal"
python -m pip install --force-reinstall tensorflow-metal=="${tensorflow-metal}" --no-input | { grep -v "already satisfied" || :; }
echo.blue "pip install django-layers-hr"
python -m pip install django-layers-hr --no-input | { grep -v "already satisfied" || :; }