本文转载自: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:

  1. sudo pip uninstall tensorflow

然后,克隆Tensorflow仓库:

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

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

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

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

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

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

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

  1. 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的安装包:

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

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

  1. 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. 【linux系列】vmware12pro安装centos7

    安装参考:http://blog.csdn.net/guin_guo/article/details/49403889 安装完成之后ip还是不成功无法连接网络: 进入/etc/sysconfig/ne ...

  2. Java多线程详解(二)

    评论区留下邮箱可获得<Java多线程设计模式详解> 转载请指明来源 1)后台线程 后台线程是为其他线程服务的一种线程,像JVM的垃圾回收线程就是一种后台线程.后台线程总是等到非后台线程死亡 ...

  3. jQuery stop()的用法

    1.stop([stopAll], [gotoEnd])方法有两个参数(当然可以不传或直传一个),其中stopAll的意思是清除之后的所有动画.gotoEnd的意思是,执行完当前动画. 2.stopA ...

  4. 域名绑定和域名解析(DNS)有什么不同?(转载)

    域名解析在DNS处设置,DNS服务器将你的域名指向你的存储网页的服务器. 域名绑定在服务器中设置,存储你网页文件的服务器绑定了你的域名才能把浏览者引导到这个域名指定的物理位置来访问. 比如,你进一个高 ...

  5. go练习4--json 序列号反序列化

    //定义结构体 //首字母大写 , json:"msg_id" 是 tag type Message struct { MsgId string `json:"msg_i ...

  6. ORA-01153: an incompatible media recovery is active

    ORA-01153: an incompatible media recovery is active Cause: Attempted to start an incompatible media ...

  7. 焦作网络赛K-Transport Ship【dp】

    There are NN different kinds of transport ships on the port. The i^{th}ith kind of ship can carry th ...

  8. python的pip的配置文件路径在哪里?如何修改pypi源?

    官方文档: https://pip.pypa.io/en/stable/user_guide/#configuration 举个例子: Windows用户想要更改pypi源,可以在%APPDATA%目 ...

  9. code sandbox & mlflow

    https://codesandbox.io/ https://www.jianshu.com/p/d70b25bf3cf4 https://my.oschina.net/u/2306127/blog ...

  10. Disruptor的伪共享解决方案

    1.术语 术语 英文单词 描述 内存屏障 Memory Barriers 是一组处理器指令,用于实现对内存操作的顺序限制. In the Java Memory Model a volatile fi ...