Mac OS X上编译TensorFlow

If you do need to build from the source, then these steps should work:

  • brew install python

  • virtualenv ~/tf

  • source ~/tf/bin/activate

  • Install bazel for Mac

  • Install PCRE (not PCRE2) for Mac

  • Install SWIG for Mac

  • git clone --recurse-submodules https://github.com/tensorflow/tensorflow

  • cd tensorflow

  • ./configure

  • bazel build -c opt //tensorflow/tools/pip_package:build_pip_package

  • bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

  • pip install /tmp/tensorflow_pkg/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

  • bazel build -c opt //tensorflow/cc:tutorials_example_trainer


你可能感兴趣的:(macosx,tensorflow)