Mac OS X 下安装 TensorFlow
2017-09-26 23:11
381 查看
-首先根据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.激活虚拟环境
$ source ~/tensorflow/bin/activate # If using bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh # If using csh or tcsh
4.若已经安装了pip8.1或者更新的版本,则可以用以下命令在激活的虚拟环境中安装tensorflow即其所有依赖
$ pip install --upgrade tensorflow # for Python 2.7
$ pip3 install --upgrade tensorflow # for Python 3.n
至此,就安装完毕了~
⚠️每次打开终端,想要使用tensorflow时,都需要激活虚拟环境
$ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh # csh or tcsh
当提示符变为以下说明已经激活
退出环境
·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.激活虚拟环境
$ source ~/tensorflow/bin/activate # If using bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh # If using csh or tcsh
4.若已经安装了pip8.1或者更新的版本,则可以用以下命令在激活的虚拟环境中安装tensorflow即其所有依赖
$ pip install --upgrade tensorflow # for Python 2.7
$ pip3 install --upgrade tensorflow # for Python 3.n
至此,就安装完毕了~
⚠️每次打开终端,想要使用tensorflow时,都需要激活虚拟环境
$ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh # csh or tcsh
当提示符变为以下说明已经激活
(tensorflow)$
退出环境
(tensorflow)$ deactivate
相关文章推荐
- Mac OS X 10.12.3安装TensorFlow
- 在Mac OS X上安装TensorFlow
- TensorFlow 安装官方教程:Ubuntu 安装,Mac OS X 安装,Windows 安装
- 在 Mac OS X 上安装 TensorFlow
- Mac OS X 安装Tensorflow
- 在 Mac OS X 上安装 TensorFlow
- tensorflow 源码安装(for MacOS)
- Mac OS X与Windows下TensorFlow的安装与升级
- 在 Mac OS X 上安装 TensorFlow
- MacPorts安装和使用--Mac OS X
- mac os x10.9 安装jdk ,配置环境变量,解决eclipse打不开问题
- VMware 11安装Mac OS X 10.11.5虚拟机以及优化心得
- VMware虚拟机安装MAC OS X Mountain Lion详细图文教程
- Mac OS X下Maven的安装与配置
- VMWare上成功安装Mac OS X Mavericks(10.9)的全部过程
- 教你在VMWare下安装MAC OS X Snow Leopard 10.6
- VMWare安装黑苹果Mac OS X SnowLeopard 10.6.7
- Mac OS X Mavericks or Yosemite 安装Nginx、PHP、Mysql、phpMyAdmin
- macOS Hight Sierra下QtDesigner的安装