Add support for Apple M1 laptops

This commit is contained in:
Oleksandr Chychkan
2022-01-31 11:08:39 -08:00
parent cff388ea89
commit d822573429
2 changed files with 45 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
numpy==1.21.4
opencv-python==4.5.3.56
numexpr==2.8.1
h5py==3.1.0
tqdm==4.62.3
colorama==0.4.4
cython==0.29.26
ffmpeg-python==0.2.0
Pillow==8.4.0
scikit-image==0.19.0
numpy==1.21.4
scipy==1.7.3
tensorflow-macos==2.7.0
PyQt6==6.0.3
+31 -2
View File
@@ -20,11 +20,40 @@ source .dfl/env/bin/activate
version=$(python -V | cut -f 2 -d ' ' | cut -f 1,2 -d .)
reqs_file='requirements.txt'
version_suffix=''
if [[ ! -z "$version" && -f "requirements_$version.txt" ]]; then
reqs_file="requirements_$version.txt"
version_suffix="_$version"
fi
architecture=''
if [[ ! -z "$(uname -a | grep -oE ' arm64$')" && -f "requirements${version_suffix}_arm64.txt" ]]; then
architecture='arm64'
fi
architecture_suffix=''
if [[ ! -z "$architecture" ]]; then
architecture_suffix="_arm64"
fi
reqs_file="requirements${version_suffix}${architecture_suffix}.txt"
echo "Using $reqs_file for $(python -V)"
pip install -r $reqs_file
if [[ ! -z "$architecture" ]]; then
if [[ -z "$(brew ls --versions hdf5)" ]]; then
echo "ERROR: HDF5 needs to be installed to run DeepFaceLab on M1 chip."
echo "You can install it with 'brew install hdf5'. For more details, see https://formulae.brew.sh/formula/hdf5"
echo "Once it is installed, run ./scripts/0_setup.sh again"
exit 1
fi
cython_pkg="$(cat $reqs_file | grep -E 'cython==.+')"
pip --no-cache-dir install $cython_pkg
h5py_pkg="$(cat $reqs_file | grep -E 'h5py==.+')"
HDF5_DIR="$(brew --prefix hdf5)" pip --no-cache-dir install --no-build-isolation $h5py_pkg
fi
pip --no-cache-dir install -r $reqs_file
echo "Done."