-首先根据https://zhuanlan.zhihu.com/p/28362186中给出的步骤实现
·1.2版本开始,Mac OS X 上TensorFlow不再支持GPU
·有四种安装方式:
·virtualenv
·本地 pip
·Docker
·从源代码安装
其中推荐了virtualenv,我也是使用了这种方法,十分简便没有出什么问题 // 与其他python项目开发隔离的虚拟python环境,安装的有TensorFlow 和它的所有依赖包
1.打开终端,首先安装pip和virtualenv
$ sudo easy_install pip
$ sudo pip install --upgrade virtualenv
2.创建虚拟环境(择一)
$ virtualenv --system-site-packages targetDirectory # for Python 2.7
$ virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n
在此处,根据教程将targetDirectory设置为 ~/tensorflow
3.激活虚拟环境