Skip to content

Instantly share code, notes, and snippets.

@netskink
Created May 28, 2019 21:38
Show Gist options
  • Select an option

  • Save netskink/2bc0f8fa9a889aae7d39177f09c1cbab to your computer and use it in GitHub Desktop.

Select an option

Save netskink/2bc0f8fa9a889aae7d39177f09c1cbab to your computer and use it in GitHub Desktop.
Building TensorFlow on OSX
Fix for xcode git problems
xcode-select --install
guide on how to build docs
https://www.tensorflow.org/community/contribute/docs
building tf from source
https://www.tensorflow.org/install/source
### Used conda to set an environment since it uses python and some packages need to be installed
conda activate py3
conda install numpy
conda install future
conda install keras
### Not required to build but used to test
conda install jupyter
conda install matplotlib
conda install pandas
conda install seaborn
cd progs/notmine/tensorflow/
./configure
### build the pip package?
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
### build the package from nightly
./bazel-bin/tensorflow/tools/pip_package/build_pip_package --nightly_flag /tmp/tensorflow_pkg
### Install the package
# of this form
pip install /tmp/tensorflow_pkg/tensorflow-version-tags.whl
# actual
pip install /tmp/tensorflow_pkg/tf_nightly-1.13.1-cp37-cp37m-macosx_10_7_x86_64.whl
# to build r2.0 my bazel was to new a version.
# i had to downgrade it.
# here are some notes on how I installed it.
397 brew tap bazelbuild/tap
398 brew install bazelbuild/tap/bazel
400 bazel version
401 brew upgrade bazelbuild/tap/bazel
454 bazel --version
455 bazel version
456 which bazel
457 brew uninstall bazel
458 brew tap bazelbuild/tap
459 brew install bazelbuild/tap/bazel
460 rm /usr/local/bin/bazel
461 brew link --overwrite bazel
# here is where I am trying to install a correct version after uninstall
http://effectif.com/mac-os-x/installing-specific-version-of-homebrew-formula
https://docs.bazel.build/versions/master/install-os-x.html
# Alternatively, config.py has a min/max version of bazel. That can be edited rather than installing specific version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment