转载请注明出处:http://blog.csdn.net/cxsydjn/article/details/71266969
TensorFlow 是谷歌开发的一款深度学习框架。它是当前最流行的之一,当然最近还有PyTorch。TensorFlow 支持分布式训练,包含TensorBoard 支持数据/结果可视化。如果你对深度学习很感兴趣的话,它不容错过。
由于MBP的GPU是Intel Iris Pro,不是NVIDIA系列卡,无奈不能支持CUDA (Compute Unified Device Architecture),(买的时候没想太多,哭),所以只能安装CPU-only的TensorFlow。
安装配置:
ItemTypeValuePCMBPr2015OSOS X EI Capitan10.11.6GPUIntel Iris Pro1536 MBCPUDDR38G*2Mac的三步安装过程可以参考 TensorFlow官网 和 TensorFlow Github仓库。
pip是一个安装、管理Python的工具[1]。Mac下利用pip(version 8.1及以上版本)进行安装TensorFlow很方便。如果已经安装了Anaconda,那pip已经集成其中了,(Mac下Anaconda配置)。
# Mac OS X $ sudo easy_install pip $ sudo easy_install --upgrade sixCPU-only的TensorFlow安装包:
# Mac OS X, CPU only, Python 2.7: $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.1.0-py2-none-any.whl # Mac OS X, CPU only, Python 3.4 or 3.5: $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.1.0-py3-none-any.whl通过官方测试样例测试是否安装成功。进入Python环境后输入以下代码,当出现”Hello, TensorFlow!”时表明已经安装成功,可正常使用了。
$ python ... >>> import tensorflow as tf >>> hello = tf.constant('Hello, TensorFlow!') >>> sess = tf.Session() >>> print(sess.run(hello)) Hello, TensorFlow!