日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

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

發布時間:2024/3/12 Ubuntu 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu16.04解决tensorflow提示未编译使用SSE3、SSE4.1、SSE4.2、AVX、AVX2、FMA的问题【转】... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本文轉載自:https://blog.csdn.net/Nicholas_Wong/article/details/70215127

rticle/details/70215127

在我的機器上出現的提示信息如下所示:

  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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 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所需要的其他依賴 [html]?view plaincopy
  • <code?class="language-html">sudo?apt-get?install?python-numpy?python-dev?python-pip?python-wheel</code>??
  • 然后進入tensorflow文件夾,運行tensorflow的配置程序:
  • cd tensorflow/
  • ./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的安裝包: [html]?view plaincopy
  • <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的问题【转】...的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。