Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cceyda/cfd64b36f39fe59d58e6c43227f2ee7b to your computer and use it in GitHub Desktop.
Save cceyda/cfd64b36f39fe59d58e6c43227f2ee7b to your computer and use it in GitHub Desktop.
Install PillowSIMD+libjpeg-turbo on Conda
pip3 install fastai==1.0.61
pip3 uninstall --force pillow -y
# install libjpeg-turbo to $HOME/turbojpeg
git clone https://github.com/libjpeg-turbo/libjpeg-turbo
pushd libjpeg-turbo
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/turbojpeg
make
make install
popd
CPATH=$HOME/turbojpeg/include LIBRARY_PATH=$HOME/turbojpeg/lib CC="cc -mavx2" pip3 install --upgrade --no-cache-dir --force-reinstall --no-binary :all: --compile pillow-simd
# add turbojpeg to LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$HOME/turbojpeg/lib:$LD_LIBRARY_PATH"
# Check success:
python3 -c "import fastai.utils; fastai.utils.check_perf()"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment