rstudio / keras3

R Interface to Keras
https://keras3.posit.co/
Other
836 stars 283 forks source link

Installation Challenges - May not be package related #129

Closed rickeycarter closed 7 years ago

rickeycarter commented 7 years ago

Setup - Macbook Pro with eGPU running properly on Sierra (10.12.6).

Anaconda installed with: Python 3.5.3 Tensorflow 1.1.0-gpu Keras 2.0.8 CUDA 8.0 and cuDNN 5.1 configured

My .bash_profile file has the following entries

export PATH=/Developer/NVIDIA/CUDA-8.0/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-8.0/lib\ ${DYLD_LIBRARY_PATH:+:$

export DYLD_LIBRARY_PATH="$CUDA_HOME/lib:$CUDA_HOME:$CUDA_HOME/extras/CUPTI/lib"
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH

export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH

# added by Anaconda3 4.2.0 installer
export PATH="/Users/<<username>>/anaconda/bin:$PATH"

I have two approaches for trying to run Keras currently. I'm looking to get the Rstudio interface running to give me a primary IDE.

Approaches without R interface: Approach 1 -- launch Spyder for editing from terminal with "spyder" command --Tensorflow runs. Keras runs. Models train quickly on GPU

Approach 2 -- launch Spyder from Anaconda dashboard -- Errors are generated saying Tensorflow is not located. This is in spite of seeing "tensorflow-gpu" version 1.1.0 listed as part of the packages under root

I've tried several iterations for getting keras to run in Rstudio. The following code seems to be a "by the book" attempt at the installation.

> library(reticulate)
> 
  > ## at this point, there appears to be the default mac python & my anaconda
  > py_discover_config()
python:         /usr/bin/python
libpython:      /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome:     /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version:        2.7.10 (default, Feb  7 2017, 00:08:15)  [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
numpy:          /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version:  1.8.1

python versions found: 
  /usr/bin/python
/Users/<<username>>/anaconda/bin/python
> ## at this point, it shows version 2.7
  > py_available(initialize=T)  #don't think this is needed
[1] TRUE
> #the following still shows version 2.7
  > py_discover_config()
python:         /usr/bin/python
libpython:      /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome:     /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version:        2.7.10 (default, Feb  7 2017, 00:08:15)  [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
numpy:          /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version:  1.8.1

python versions found: 
  /usr/bin/python
/Users/<<username>>/anaconda/bin/python
> 
  > 
  > # I'm thinking at this point, Keras will go into a virtual environment in the 
  > # 2.7 python install
  > install.packages("keras")
Installing package into ‘/Users/<<username>>/Library/R/3.3/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘tensorflow’, ‘tfruns’

trying URL 'https://mirrors.nics.utk.edu/cran/bin/macosx/mavericks/contrib/3.3/tensorflow_1.3.1.tgz'
Content type 'application/x-gzip' length 59744 bytes (58 KB)
==================================================
  downloaded 58 KB

trying URL 'https://mirrors.nics.utk.edu/cran/bin/macosx/mavericks/contrib/3.3/tfruns_0.9.1.tgz'
Content type 'application/x-gzip' length 148283 bytes (144 KB)
==================================================
  downloaded 144 KB

trying URL 'https://mirrors.nics.utk.edu/cran/bin/macosx/mavericks/contrib/3.3/keras_2.0.6.tgz'
Content type 'application/x-gzip' length 1600624 bytes (1.5 MB)
==================================================
  downloaded 1.5 MB

The downloaded binary packages are in
/var/folders/w6/ng3s613x6d9gyvfnl5l2yknjhtnwg4/T//RtmpwaOuIc/downloaded_packages
> 
  > #now check to see what the python config looks like
  > py_discover_config()
python:         /usr/bin/python
libpython:      /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome:     /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version:        2.7.10 (default, Feb  7 2017, 00:08:15)  [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
numpy:          /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version:  1.8.1

python versions found: 
  /usr/bin/python
/Users/<<username>>/anaconda/bin/python
> #the above still reflects the 2.7 default python install...I think that is good
  > 
  > library(keras)
Error : .onLoad failed in loadNamespace() for 'tensorflow', details:
  call: py_module_import(module, convert = convert)
error: ImportError: No module named tensorflow
Error: package or namespace load failed for ‘keras’

For take 2 at getting keras to install in r, I removed reticulate, keras, tensorflow and tfruns and gave it another go. This time, I tried to switch the python environment. The error changes to one that looks like the straight python approach 2 error listed above. For this reason, I'm thinking the issue might be related to environment variables and possible "confusion" of which python is which in Rstudio.

Second install log with error.

> install.packages("reticulate")
Installing package into ‘/Users/<<username>>/Library/R/3.3/library’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.nics.utk.edu/cran/bin/macosx/mavericks/contrib/3.3/reticulate_1.1.tgz'
Content type 'application/x-gzip' length 655700 bytes (640 KB)
==================================================
  downloaded 640 KB

The downloaded binary packages are in
/var/folders/w6/ng3s613x6d9gyvfnl5l2yknjhtnwg4/T//Rtmpqsztbl/downloaded_packages
> 
  > library(reticulate)
> 
  > ## at this point, there appears to be the default mac python & my anaconda
  > py_discover_config()
python:         /usr/bin/python
libpython:      /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome:     /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version:        2.7.10 (default, Feb  7 2017, 00:08:15)  [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
numpy:          /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version:  1.8.1

python versions found: 
  /usr/bin/python
/Users/<<username>>/anaconda/bin/python
> 
  > ## now try to switch environments
  > use_python("/Users/<<username>>/anaconda/bin/python")
> py_available()
[1] FALSE
> py_available(initialize = T)
[1] TRUE
> py_available()  #now shows true
[1] TRUE
> 
  > py_config()
python:         /Users/<<username>>/anaconda/bin/python
libpython:      /Users/<<username>>/anaconda/lib/libpython3.5m.dylib
pythonhome:     /Users/<<username>>/anaconda:/Users/<<username>>/anaconda
version:        3.5.3 |Anaconda custom (x86_64)| (default, Mar  6 2017, 12:15:08)  [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
numpy:          /Users/<<username>>/anaconda/lib/python3.5/site-packages/numpy
numpy_version:  1.12.1

python versions found: 
  /Users/<<username>>/anaconda/bin/python
/usr/bin/python
> 
  > ## now see if I can load the keras package
  > install.packages("keras")
Installing package into ‘/Users/<<username>>/Library/R/3.3/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘tensorflow’, ‘tfruns’

trying URL 'https://mirrors.nics.utk.edu/cran/bin/macosx/mavericks/contrib/3.3/tensorflow_1.3.1.tgz'
Content type 'application/x-gzip' length 59744 bytes (58 KB)
==================================================
  downloaded 58 KB

trying URL 'https://mirrors.nics.utk.edu/cran/bin/macosx/mavericks/contrib/3.3/tfruns_0.9.1.tgz'
Content type 'application/x-gzip' length 148283 bytes (144 KB)
==================================================
  downloaded 144 KB

trying URL 'https://mirrors.nics.utk.edu/cran/bin/macosx/mavericks/contrib/3.3/keras_2.0.6.tgz'
Content type 'application/x-gzip' length 1600624 bytes (1.5 MB)
==================================================
  downloaded 1.5 MB

The downloaded binary packages are in
/var/folders/w6/ng3s613x6d9gyvfnl5l2yknjhtnwg4/T//Rtmpqsztbl/downloaded_packages
> library(keras)
Error : .onLoad failed in loadNamespace() for 'tensorflow', details:
  call: py_module_import(module, convert = convert)
error: ImportError: Traceback (most recent call last):
  File "/Users/<<username>>/anaconda/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/<<username>>/anaconda/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
  _pywrap_tensorflow_internal = swig_import_helper()
File "/Users/<<username>>/anaconda/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/Users/<<username>>/anaconda/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/Users/<<username>>/anaconda/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: dlopen(/Users/<<username>>/anaconda/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib
Referenced from: /Users/<<username>>/anaconda/lib/python3.5/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
Reason: image not found

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
Error: package or namespace load failed for ‘keras’

The note on "Library not loaded @rpath/libcublas.8.0.dylib" seems like the path or symbolic link. Is it as simple as not using .bash_profile and instead using .bashrc? Or, is it more complicated with python references. I've tried to research but I haven't found the solution.

jjallaire commented 7 years ago

It doesn't look like you called install_keras() anywhere. That should install Keras in an r-tensorflow virtual environment which should be found by default by the keras and tensorflow R packages.

rickeycarter commented 7 years ago

I did run install_keras() in a variety of ways, but apparently I didn't include those errors above. As a summary, I can have it such that the library(keras) will cause an error or that when keras is installed with install_keras(tensorflow="1.1.0-gpu") it can't find the links to the cuDNN libraries. I've tried running system commands to define the symbolic links or the environment variables. R seems to want to default back to the default mac python (/usr/bin/python). It seems to be related to environment variable since running "spyder" at the command prompt in a terminal shell will work with keras and tensorflow, but launching spyder from Anaconda misses the cuDNN libraries just like is happening within R.

jjallaire commented 7 years ago

I think the problem may be related to the fact that Mac desktop applications don't see what's in .bash_profile by default (you can probably confirm this by calling Sys.getenv() from within the RStudio session). I think for this you need to create a .plist file for environment variables as described here: https://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks

rickeycarter commented 7 years ago

Here's a test of what's happening

library(keras)
install_keras(tensorflow="1.1.0-gpu")

now <- Sys.time()

# the data, shuffled and split between train and test sets
data <- dataset_mnist()

This is the log


R version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.4.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from ~/.RData]

> library(keras)
> install_keras(tensorflow="1.1.0-gpu")
Using existing virtualenv at  ~/.virtualenvs/r-tensorflow 
Upgrading pip ...
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-9.0.1
Upgrading wheel ...
Collecting wheel
Using cached wheel-0.30.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.30.0
Upgrading setuptools ...
Collecting setuptools
Using cached setuptools-36.4.0-py2.py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-36.4.0
Installing TensorFlow ...
Collecting tensorflow-gpu==1.1.0
Using cached tensorflow_gpu-1.1.0-cp27-cp27m-macosx_10_11_x86_64.whl
Collecting h5py
Using cached h5py-2.7.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting pyyaml
Collecting requests
Using cached requests-2.18.4-py2.py3-none-any.whl
Collecting Pillow
Using cached Pillow-4.2.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting keras
Using cached Keras-2.0.8-py2.py3-none-any.whl
Collecting scipy
Using cached scipy-0.19.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting werkzeug>=0.11.10 (from tensorflow-gpu==1.1.0)
Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow-gpu==1.1.0)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting wheel (from tensorflow-gpu==1.1.0)
Using cached wheel-0.30.0-py2.py3-none-any.whl
Collecting numpy>=1.11.0 (from tensorflow-gpu==1.1.0)
Using cached numpy-1.13.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting mock>=2.0.0 (from tensorflow-gpu==1.1.0)
Using cached mock-2.0.0-py2.py3-none-any.whl
Collecting protobuf>=3.2.0 (from tensorflow-gpu==1.1.0)
Using cached protobuf-3.4.0-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests)
Using cached idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests)
Using cached urllib3-1.22-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
Using cached certifi-2017.7.27.1-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
Using cached chardet-3.0.4-py2.py3-none-any.whl
Collecting olefile (from Pillow)
Collecting funcsigs>=1; python_version < "3.3" (from mock>=2.0.0->tensorflow-gpu==1.1.0)
Using cached funcsigs-1.0.2-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock>=2.0.0->tensorflow-gpu==1.1.0)
Using cached pbr-3.1.1-py2.py3-none-any.whl
Collecting setuptools (from protobuf>=3.2.0->tensorflow-gpu==1.1.0)
Using cached setuptools-36.4.0-py2.py3-none-any.whl
Installing collected packages: werkzeug, six, wheel, numpy, funcsigs, pbr, mock, setuptools, protobuf, tensorflow-gpu, h5py, pyyaml, idna, urllib3, certifi, chardet, requests, olefile, Pillow, scipy, keras
Successfully installed Pillow-4.2.1 certifi-2017.7.27.1 chardet-3.0.4 funcsigs-1.0.2 h5py-2.7.1 idna-2.6 keras-2.0.8 mock-2.0.0 numpy-1.13.1 olefile-0.44 pbr-3.1.1 protobuf-3.4.0 pyyaml-3.12 requests-2.18.4 scipy-0.19.1 setuptools-36.4.0 six-1.10.0 tensorflow-gpu-1.1.0 urllib3-1.22 werkzeug-0.12.2 wheel-0.30.0

Installation of TensorFlow complete.

Installation of Keras complete.

> data <- dataset_mnist()
Using TensorFlow backend.
Error in py_module_import(module, convert = convert) : 
  ImportError: Traceback (most recent call last):
  File "/Users/<<username>>/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/<<username>>/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
  _pywrap_tensorflow_internal = swig_import_helper()
File "/Users/<<username>>/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: dlopen(/Users/<<username>>/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib
Referenced from: /Users/<<username>>/.virtualenvs/r-tensorflow/lib/python2.7/site-packages/tensorflow/pyth
In addition: Warning message:
  In stop(e, call. = FALSE) : additional arguments ignored in stop()

The results of Sys.getenv() is this

> Sys.getenv()
__CF_USER_TEXT_ENCODING
0x61AAF1E4:0x0:0x0
Apple_PubSub_Socket_Render
/private/tmp/com.apple.launchd.gJ21R1AQ9l/Render
COMMAND_MODE            unix2003
DISPLAY                 /private/tmp/com.apple.launchd.ned6xG1YtT/org.macosforge.xquartz:0
DYLD_FALLBACK_LIBRARY_PATH
/Library/Frameworks/R.framework/Resources/lib:/Users/<<username>>/lib:/usr/local/lib:/usr/lib::
  EDITOR                  vi
GIT_ASKPASS             rpostback-askpass
HOME                    /Users/<<username>>
LANG                    en_US.UTF-8
LC_CTYPE                en_US.UTF-8
LN_S                    ln -s
LOGNAME                 <<username>>
MAKE                    make
PAGER                   /usr/bin/less
PATH                    /Users/<<username>>/.virtualenvs/r-tensorflow/bin:/Users/<<username>>/.virtualenvs/r-tensorflow/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
R_BROWSER               /usr/bin/open
R_BZIPCMD               /usr/bin/bzip2
R_DOC_DIR               /Library/Frameworks/R.framework/Resources/doc
R_GZIPCMD               /usr/bin/gzip
R_HOME                  /Library/Frameworks/R.framework/Resources
R_INCLUDE_DIR           /Library/Frameworks/R.framework/Resources/include
R_LIBS_SITE             
R_LIBS_USER             ~/Library/R/3.3/library
R_PAPERSIZE             a4
R_PDFVIEWER             /usr/bin/open
R_PLATFORM              x86_64-apple-darwin13.4.0
R_PRINTCMD              lpr
R_QPDF                  /Library/Frameworks/R.framework/Resources/bin/qpdf
R_RD4PDF                times,inconsolata,hyper
R_SESSION_TMPDIR        /var/folders/w6/ng3s613x6d9gyvfnl5l2yknjhtnwg4/T//Rtmp10Jeq3
R_SHARE_DIR             /Library/Frameworks/R.framework/Resources/share
R_SYSTEM_ABI            osx,gcc,gxx,gfortran,?
R_TEXI2DVICMD           /usr/local/bin/texi2dvi
R_UNZIPCMD              /usr/bin/unzip
R_ZIPCMD                /usr/bin/zip
RMARKDOWN_MATHJAX_PATH
/Applications/RStudio.app/Contents/Resources/resources/mathjax-26
RS_RPOSTBACK_PATH       /Applications/RStudio.app/Contents/MacOS/rpostback
RS_SHARED_SECRET        6f83ef69-6b23-49d0-917a-e2aefba3b838
RSTUDIO                 1
RSTUDIO_PANDOC          /Applications/RStudio.app/Contents/MacOS/pandoc
RSTUDIO_SESSION_PORT    37083
RSTUDIO_USER_IDENTITY   <<username>>
RSTUDIO_WINUTILS        bin/winutils
SED                     /usr/bin/sed
SHELL                   /bin/bash
SSH_AUTH_SOCK           /private/tmp/com.apple.launchd.K5yz0M2vBT/Listeners
TAR                     /usr/bin/tar
TMPDIR                  /var/folders/w6/ng3s613x6d9gyvfnl5l2yknjhtnwg4/T/
  USER                    <<username>>
VIRTUAL_ENV             /Users/<<username>>/.virtualenvs/r-tensorflow
XPC_FLAGS               0x0
XPC_SERVICE_NAME        0
rickeycarter commented 7 years ago

I attempted a few different scenarios.

Launching and running a script from the command line with Rscript <>. This works beautifully just as the spyder command above when launched from the terminal. The conclusion is it is related to the environment variables.

Problems - the plist suggestion seems to be hard to manage and it created conflicts with other environmental variables.

Possible work around, but not successful as of yet...

tpath <- Sys.getenv("PATH")
newpath <- paste0(tpath, ":/Developer/NVIDIA/CUDA-8.0/bin/lib")
Sys.setenv(PATH=newpath)

This does seem to append the path scope in R when evaluated with Sys.getenv(). The dynamic libraries seems to be different. I don't see a "DYLD_LIBRARY_PATH" variable in R. There is a DYLD_FALLBACK_LIBRARY_PATH. Perhaps these function the same.

We made a little progress, but still something isn't quite right.

jjallaire commented 7 years ago

You actually can't set DYLD_LIBRARY_PATH during the R session, it needs to be set before the session starts (thus the .bash_profile or .plist requirement).

Another way to bootstrap without getting involve with the .plist is to launch RStudio from your bash terminal, e.g.

open -a RStudio
rickeycarter commented 7 years ago

Well, look at that. That does the trick!

For those that may follow, could the installation instructions be updated some to indicate if you are using a Mac with a properly configured GPU configuration (i.e., Python will utilize Keras and Tensorflow), the necessary environment variables to the deep learning libraries may not load unless you launch RStudio from a command prompt using open -a RStudio?

jjallaire commented 7 years ago

I've updated the docs on Mac GPU installation with this info, as well as a note on the fact that GPU support for Macs was discontinued in TF v1.1 and cuDNN 6.0: https://tensorflow.rstudio.com/tensorflow/articles/installation_gpu.html#mac-os-x