本文转载自:https://blog.csdn.net/Nicholas_Wong/article/details/70215127

rticle/details/70215127

在我的机器上出现的提示信息如下所示:

  1.  
    W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
  2.  
    W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
  3.  
    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.
  4.  
    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.
  5.  
    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.
  6.  
    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.<span> </span>

那么需要说明的是:这些是warnings,不是error。这些warings的意思是说:你的机器上有这些指令集可以用,并且用了他们会加快你的CPU运行速度,但是你的TensorFlow在编译的时候并没有用到这些指令集。

我的tensorflow在安装的时候采用的pip install指令,这种安装方式会存在这种问题。主要有两种解决方法,一种是修改警告信息的显示级别,使这种信息不再出现,另外一种就是自己重新编译安装tensorflow,在编译的时候使用这些指令集。这里我尝试第二种解决方法。并且由于我的机器上没有高效的GPU,所以我尝试安装的是CPU版本。

首先,卸载已经安装的tensorflow:

sudo pip uninstall tensorflow

然后,克隆Tensorflow仓库:

git clone --recurse-submodules https://github.com/tensorflow/tensorflow

上面的命令会在你的当前文件夹中创建一个叫做“tensorflow”的文件夹,下载的文件都存在里面。

由于编译安装tensorflow的时候要用到Bazel工具,所以接下来我们安装Bazel。按照官网指导输入以下命令:

echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install bazel
sudo apt-get upgrade bazel

然后安装tensorflow所需要的其他依赖

  1. <code class="language-html">sudo apt-get install python-numpy python-dev python-pip python-wheel</code>

然后进入tensorflow文件夹,运行tensorflow的配置程序:

  1.  
    cd tensorflow/
  2.  
    ./configure

对我来说,在配置过程中出现如下错误:

Problem with java installation: couldn't find/access rt.jar in /usr/lib/jvm/java-9-openjdk-amd64

我没有仔细研究原因,但是我用如下命令把java-9卸载之后就没有问题了。

sudo apt-get purge openjdk-9*

然后用如下命令来生成一个pip的安装包:

  1. <code class="language-html">bazel build -c opt --copt=-msse3 --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx --copt=-mavx2 --copt=-mfma //tensorflow/tools/pip_package:build_pip_package</code>

这是一个相当耗时的过程。

上述命令会生成一个叫做build_pip_package的脚本,按照如下命令运行这个脚本,在/tmp/tensorflow_pkg文件夹中创建pip的安装包:

bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

然后运行下面的命令来安装。需要说明的是,由于平台的不同,可能软件包的名字是不一样的。

sudo pip install /tmp/tensorflow_pkg/tensorflow-1.1.0rc1-cp27-cp27mu-linux_x86_64.whl

安装成功,意味着大功告成。

ubuntu16.04解决tensorflow提示未编译使用SSE3、SSE4.1、SSE4.2、AVX、AVX2、FMA的问题【转】的更多相关文章

  1. Ubuntu16.04安装TensorFlow及Mnist训练

    版权声明:本文为博主原创文章,欢迎转载,并请注明出处.联系方式:460356155@qq.com TensorFlow是Google开发的开源的深度学习框架,也是当前使用最广泛的深度学习框架. 一.安 ...

  2. Ubuntu16.04下的modules模块编译加载

    一.首先编写对应的驱动程序的相关内容:(最简单的hello.c程序) #include<linux/init.h> #include<linux/module.h> MODUL ...

  3. Ubuntu16.04.2 LTS下使用编译安装程序(使用configure、make、 make install)

    以安装vim为例. (vim 是vi的升级版本,它不仅兼容vi的所有指令,而且还有一些新的特性在里面). 1.获取源文件 首先进入/usr/local下(只是为了方便处理安装文件,位置随意) 用git ...

  4. Ubuntu16.04安装tensorflow+安装opencv+安装openslide+安装搜狗输入法

    Ubuntu16.04在cuda以及cudnn安装好之后,安装tensorflow,tensorflow以及opencv可以到网上下载对应的安装包并且直接在安装包所在的路径下直接通过pip与conda ...

  5. Tensorflow源码编译,解决tf提示未使用SSE4.1 SSE4.2 AVX警告【转】

    本文转载自:https://blog.csdn.net/iTaacy/article/details/72799833 版权声明:欢迎转载,转载请注明出处! https://blog.csdn.net ...

  6. 腾讯云ubuntu16.04安装MySql5.7未提示密码设置且无法登陆解决

    一.安装 sudo apt-get update sudo apt install mysql-server 二.修改密码 1.由于安装过程中未提示要设置密码,且使用sudo mysql_secure ...

  7. 解决 Ubuntu16.04 + opencv4.1 源码编译错误 Makefile:160: recipe for target 'all' failed

    最近源码编译 opencv,出现下面的错误 [ %] Built target opencv_dnn Makefile:: recipe for target 'all' failed google ...

  8. 解决TensorFlow最新代码编译错误问题

    老是有个习惯,看到开源代码更新了,总是想更新到最新版,如果置之不理的话,就感觉自己懒惰了或有的不负责任了,这个也可能是一种形式的强迫症吧: 前几天晚上git pull TensorFlow,完事后也没 ...

  9. ubuntu16.04运行ros的时候编译工作空间catkin_make出现的一个问题Could not find a package configuration file provided by

    最近在进行ros里面的gazebo仿真之前需要对自己创建的工作空间进行编译,但是进行编译的时候输入catkin_make出现如下错误提示 查阅ROS问答社区之后发现两个比较有用的链接,如下 https ...

随机推荐

  1. 网络电话pjsip Getting Started: Building for Apple iPhone, iPad and iPod Touch

    Getting Started: Building for Apple iPhone, iPad and iPod Touch ¶ Getting Started Preparation Get th ...

  2. ubuntu 14.04 返回到经典桌面方法

    1.打开终端,运行下面命令:sudo apt-get install gnome-session-fallback 2.重启机器,选择gnome,然后登录

  3. linux动态查看某组进程状态的办法

    这里记录一下我监控某组进程的解决办法. 1.首先要获取要监控的进程的进程id,如果你要勇ps grep 那你就out了,强大的linux系统有一个pidof命令,用来查找相关进程的进程id,其实还有一 ...

  4. DG快照备库

    1.使用快照先决条件:主备库开启闪回功能 2.把备库转为快照库 DGMGRL> convert database satest to SNAPSHOT STANDBY; Converting d ...

  5. 微信小程序 --- toast消息提示框

    toast:是用于进行提示用户的: 效果: 代码: <toast hidden="{{onOff}}" duration="1000" bindchang ...

  6. 摄像头的管理(camera) ---- HTML5+

    模块:camera Camera模块管理设备的摄像头,可用于拍照.摄像操作,通过plus.camera获取摄像头管理对象. 应用场景:保存自拍,保存照片,上传照片,保存视频,上传视频: 通过之前的模块 ...

  7. CEIL与FLOOR

    SQL> SELECT 666.88,CEIL(666.88),FLOOR(666.88) FROM dual;    666.88 CEIL(666.88) FLOOR(666.88)---- ...

  8. 编程中,static的用法详解

    C++的static有两种用法:面向过程程序设计中的static和面向对象程序设计中的static.前者应用于普通变量和函数,不涉及类:后者主要说明static在类中的作用.一.面向过程设计中的sta ...

  9. [转]CentOS 6.4下Squid代理服务器的安装与配置

    一.简介 代理服务器英文全称是Proxy Server,其功能就是代理网络用户去取得网络信息. Squid是一个缓存Internet 数据的软件,其接收用户的下载申请,并自动处理所下载的数据.当一个用 ...

  10. 不走标准路的微软:少一个斜杠的URI Path

    今天又被微软不按标准的做法折腾了一下,写篇博文抱怨一下. 我们先来看一下IETF(Internet Engineering Task Force)对URI结构的标准定义(链接): 注意上面的path部 ...