Skip to content

Instantly share code, notes, and snippets.

@yoavram
Created April 11, 2018 08:21
Show Gist options
  • Save yoavram/67ab1e9d6f891609d4e9f50ceff3454c to your computer and use it in GitHub Desktop.
Save yoavram/67ab1e9d6f891609d4e9f50ceff3454c to your computer and use it in GitHub Desktop.
Build TensorFlow on MacOS as of Dec 21 2017
# https://www.tensorflow.org/install/install_sources
brew install bazel
conda create -n tensorflow python six numpy wheel -y
source activate tensorflow
git clone https://github.com/tensorflow/tensorflow
cd tensorflow
./configure
# I chose "no" for everything except for "XLA/JIT"
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
# if it fails you can try running ./configure again with different choices
bazel-bin/tensorflow/tools/pip_package/build_pip_package .
python -m pip install tensorflow-1.4.0-cp36-cp36m-macosx_10_9_x86_64.whl
cd .. # you have to leave the tensorflow repo folder before importing it
python -c "import tensorflow as tf;print(tf.Session().run(tf.constant('Hello, World!')))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment