Mac下安装TensorFlow步骤较简单,官方给出的只有3步:
Install pip (or pip3 for python3) if it is not already installed:
$ sudo easy_install pip
Install TensorFlow:
$ sudo easy_install --upgrade six
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl
按照步骤安装,基本就可以了。
验证TensorFlow是否安装成功:
$ python
Python 2.7.11 (default, Jan 22 2016, 08:29:18)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>import tensorflow
不报错则说明安装成功。
由于之前安装caffe的时候安装了protobuf,但是版本和TenforFlow有冲突,所以第一次导入的时候出现了错误:
TypeError: __init__() got an unexpected keyword argument 'syntax'
只需更新下protobuf即可:
$ brew reinstall --devel protobuf
更新完成后,就能够成功导入了。
本文详细介绍在Mac系统上安装TensorFlow的过程,包括安装pip、使用easy_install升级six及安装TensorFlow轮子文件等步骤,并解决protobuf版本冲突问题。

620

被折叠的 条评论
为什么被折叠?



