How to install TensorFlow-GPU 1.5.0 on MacOS (HighSierra, 10.13.3)

Welcome to CS With James

Since the TensorFlow doesn’t support the GPU version on MacOS anymore, the Mac users have to build the TensorFlow from the source code. 

If you have ever build those big project from the source, you know that is such a pain to do so. 

I have already build the TensorFlow 1.5.0 for MacOS so you can simply download it and pip install.

Here are the wheel files

You need CUDA Toolkit 9.0 and cuDNN 7.0

Python3.6

Python2

 

2 thoughts on “How to install TensorFlow-GPU 1.5.0 on MacOS (HighSierra, 10.13.3)”

  1. Brilliant… I have a MacBook Pro 13″ 2017 version running Cuda 9 and Cudnn 7 which works fine for my MXNet that compiled from course. However when I attempt to use this Tensorflow I get the following errors, any idea?

    “`
    >>> import tensorflow as tf
    Traceback (most recent call last):
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py”, line 58, in
    from tensorflow.python.pywrap_tensorflow_internal import *
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py”, line 28, in
    _pywrap_tensorflow_internal = swig_import_helper()
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/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/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/imp.py”, line 243, in load_module
    return load_dynamic(name, filename, file)
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/imp.py”, line 343, in load_dynamic
    return _load(spec)
    ImportError: dlopen(/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Library not loaded: @rpath/libcublas.9.0.dylib
    Referenced from: /Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
    Reason: image not found

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “”, line 1, in
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/__init__.py”, line 24, in
    from tensorflow.python import *
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/__init__.py”, line 49, in
    from tensorflow.python import pywrap_tensorflow
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py”, line 74, in
    raise ImportError(msg)
    ImportError: Traceback (most recent call last):
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py”, line 58, in
    from tensorflow.python.pywrap_tensorflow_internal import *
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py”, line 28, in
    _pywrap_tensorflow_internal = swig_import_helper()
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/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/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/imp.py”, line 243, in load_module
    return load_dynamic(name, filename, file)
    File “/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/imp.py”, line 343, in load_dynamic
    return _load(spec)
    ImportError: dlopen(/Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 6): Library not loaded: @rpath/libcublas.9.0.dylib
    Referenced from: /Users/niklas/development/tensorflowgpu/tensorflowgpu/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
    Reason: image not found

    Failed to load the native TensorFlow runtime.
    “`

  2. Right, I’m on Cuda 9.1, as I thought 9.0 wouldn’t install on Mac OS 10.13.3…

    Do you have any pointers as to how to compile this from scratch… seems more complicated than building MXNet…

Leave a Reply

Your email address will not be published. Required fields are marked *