TensorFlow入门:mac 安装 TensorFlow
开发环境:
mac os 10.12.5
Python 2.7.10
GCC 4.2.1
mac默认是不带pip的,安装pip。
sudo easy_install pip
1.安装virtualenv
sudo pip install virtualenv --upgrade
创建一个工作目录:
sudo virtualenv --system-site-packages ~/tensorflow
进行该目录,激活沙箱
cd ~/tensorflow
source bin/activate
2.virtualenv里安装TensorFlow
进入沙箱后,执行下面的命令来安装TensorFlow:
(tensorflow)$ sudo pip install tensorflow==1.2.1
3.运行TensorFlow
...
environment /Users/***/tensorflow
Successfully installed backports.weakref-1.0rc1 bleach-1.5.0 funcsigs-1.0.2 html5lib-0.9999999 markdown-2.6.8 mock-2.0.0 numpy-1.13.0 pbr-3.1.1 protobuf-3.3.0 six-1.10.0 tensorflow-1.2.1 werkzeug-0.12.
hello world测试一下:
$ python
Python 2.7.10 (default, Feb 7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import tensorflow as tf
>>> hello =tf.constant('hello world!')
>>> sess = tf.Session()
2017-07-05 23:58:34.771619: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-07-05 23:58:34.771654: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-07-05 23:58:34.771663: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-07-05 23:58:34.771671: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
>>> print sess.run(hello)
hello world!
恭喜,TensorFlow安装成功了。
*每次运行TensorFlow程序时,都需要进入tensorflow目录,然后执行source bin/activate 命令来激活沙箱。
*Ubuntu/Linux也可以按Mac os准备。TensorFlow安装版本分为CPU版和GPU版,区别在于:
(tensorflow)$ sudo pip install tensorflow==1.2.1
(tensorflow)$ sudo pip install tensorflow-gpu==1.2.1
TensorFlow入门:mac 安装 TensorFlow的更多相关文章
- mac安装tensorflow报错
问题:mac安装tensorflow过程中,爆出oserror:permission denied 解决方案:关闭mac的sip,然后sudo安装 关闭sip的方法:重启mac,按住command+R ...
- mac安装tensorflow
tensorflow简介 TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,其命名来源于本身的运行原理.Tensor(张量)意味着N维数组,Flow(流)意味着基于数 ...
- Mac 安装tensorflow
一. 安装 TensorFlow谷歌的官网和开源项目都有介绍各个系统的安装和使用(官网:https://www.tensorflow.org/install git: https://github.c ...
- AI mac安装TensorFlow
1.安装pip sudo easy_install pip 2.安装virtualenv sudo pip install --upgrade virtualenv 3.在指定目录创建virtuale ...
- tensorflow入门——5tensorflow安装
你将把你学到的神经网络的知识,借助 TensorFlow ,一个 Google 开源的深度学习框架,应用在真实的数据集中. 你将使用 TensorFlow 来辨别 notMNIST 数据集.它是一个由 ...
- 【tensorflow】1.安装Tensorflow开发环境,安装Python 的IDE--PyCharm
================================================== 安装Tensorflow开发环境,安装Python 的IDE--PyCharm 1.PyCharm ...
- Tensorflow入门(安装)
TensorFlow是将复杂的数据结构传输至人工智能神经网中进行分析和处理过程的系统.主要用于深度学习(神经网络)方面的研究与应用.Tensorflow适用与Python.C++.Java,本博客中主 ...
- TensorFlow入门:安装常用的依赖模块
TensorFlow运行中常用到一些Python第三方模块: numpy 存储和处理大型矩阵的科学计算包 maplotlib 最著名的绘图库 jupyter scikit-image 图像预处理 li ...
- 【Tensorflow】Ubuntu 安装 Tensorflow gpu
安装环境:Ubuntu 16.04lts 64位,gcc5.4 1.安装Cuda 1. 下载cuda toolkit. 下载cuda8.0 地址:https://developer.nvidia.co ...
随机推荐
- 【BZOJ1047】[HAOI2007]理想的正方形 (倍增ST表)
[HAOI2007]理想的正方形 题目描述 有一个\(a*b\)的整数组成的矩阵,现请你从中找出一个\(n*n\)的正方形区域,使得该区域所有数中的最大值和最小值的差最小. 输入输出格式 输入格式: ...
- jeesite模块解析,功能实现
做为十分优秀的开源框架,JeeSite拥有着很多实用性的东西. 默认根路径跳转 定义了无Controller的path<->view直接映射 <mvc:view-controller ...
- bzoj2212 Tree Rotations 线段树合并+动态开点
题目传送门 思路: 区间合并线段树的题,第一次写,对于一颗子树,无论这个子树怎么交换,都不会对其他子树的逆序对造成影响,所以就直接算逆序对就好. 注意叶子节点是1到n的全排列,所以每个权值都只会出现1 ...
- bzoj4034 树上操作 树链剖分+线段树
题目传送门 题目大意: 有一棵点数为 N 的树,以点 1 为根,且树点有权.然后有 M 个操作,分为三种: 操作 1 :把某个节点 x 的点权增加 a . 操作 2 :把某个节点 x 为根的子树中所有 ...
- ASP.NET与.NET区别
1.NET是什么? .Net全称.NET Framework是一个开发框架,不是一门编程语言,简单的来说 就是一组类库框架,.NET开发支持C#.VB.NET.J#.Js和Managed C++等 其 ...
- [转] git忽略已经被提交的文件
[From] https://segmentfault.com/q/1010000000430426 正确的做法应该是:git rm --cached logs/xx.log,然后更新 .gitign ...
- 破解MyEclipse
- while循环案例
class While05{ public static void main(String[ ]args){ //练习1:使用while循环完成输出1------10中的每个数 /*int i =1; ...
- 用poi替换ppt中的文字和图片
try { // 获取PPT文件 String pptModelPath =ConfigReadUtil.getInstance().getConfigI ...
- c#实现常用排序算法
让我们先看一看常用排序算法的效率对比 接着请看代码和注释~ using System; using System.Collections.Generic; using System.Linq; usi ...