Current as of Sept 6, 2017
I have a MacBook Pro Retina 2013 and I had a hard time setting up TensorFlow with GPU support from all the conflicting information out there. I hope this gets you up and running training models on your local computer!
- Download the CUDA Toolkit 8.0 for macOS here. Install it using the DMG package.
- Edit your ~/.bash_profile file and add the following line:
export DYLD_LIBRARY_PATH="/Developer/NVIDIA/CUDA-8.0/lib:$DYLD_LIBRARY_PATH" - Download the CUDA DNN v5.1 from here. This requires you to sign up as an NVIDIA Developer.
- Unzip the CUDA DNN package and copy the files inside the
includefolder toDeveloper/NVIDIA/CUDA-8.0/includeand copy the files inside thelibfolder intoDeveloper/NVIDIA/CUDA-8.0/lib - Inside your terminal, do
source ~/.bash_profile - Inside your Python environment, do
pip install tensorflow-gpu. If you have tensorflow (regular CPU version) already installed, you will need to uninstall it first withpip uninstall tensorflow. If you aren't using an Virtual Environment to keep you python stuff separate, I highly recommend it (check it out here. - Confirm your installation by entering
python -c "import tensorflow"in your terminal.
That's all!
this installs legacy tensorflow 1.1