从Tensorflow1.2开始,不再支持GPU在Mac OS X上的安装。
TensorFlow安装命令
$ pip install tensorflow # Python 2.7; CPU support
$ pip3 install tensorflow # Python 3.n; CPU support
如果上面的安装出错,可以通过以下命令安装最新的TensorFlow:
$ sudo pip install --upgrade tfBinaryURL # Python 2.7
$ sudo pip3 install --upgrade tfBinaryURL # Python 3.n
where tfBinaryURL identifies the URL of the TensorFlow Python package. The appropriate value of tfBinaryURL depends on the operating system and Python version. Find the appropriate value for tfBinaryURL here. For example, if you are installing TensorFlow for Mac OS and Python 2.7 issue the following command:
$ sudo pip3 install --upgrade \
https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.3.0-py2-none-any.whl
上面以安装TensorFlow 1.3.0为例,若输入的是pip,则为python2安装TensorFlow 1.3.0
更新TensorFlow
(tensorflow)$ pip install --upgrade tensorflow # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow # for Python 3.n