1. 程式人生 > >tensorflow執行提示未編譯使用SSE4.1,SSE4.2等問題的解決方法

tensorflow執行提示未編譯使用SSE4.1,SSE4.2等問題的解決方法

問題描述

每次執行TensorFlow 程式時,總是會提示未編譯使用SSE4.1,SSE4.2等warnings 警告。

import tensorflow as tf
a = tf.constant(32)
b = tf.constant(2)
x = tf.add(a,b)

with tf.Session() as sess:
    print(sess.run(x))

執行結果:

2018-06-22 20:45:54.006037: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core
\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations. 2018-06-22 20:45:54.031420: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\tensorflow\core\platform\cpu_feature_guard.cc:45]
The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations. 2018-06-22 20:45:54.035185: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\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. 2018-06-22 20:45:54.039599: W c:\tf
_jenkins\home\workspace\release-win\m\windows\py\35\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. 2018-06-22 20:45:54.043053: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\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. 2018-06-22 20:45:54.048017: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\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. 2018-06-22 20:45:54.054038: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\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. 2018-06-22 20:45:54.061881: W c:\tf_jenkins\home\workspace\release-win\m\windows\py\35\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. 34

解決方法

在開始時匯入

import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'

即可解決,還你一個清爽的結果。解救強迫症。

import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
a = tf.constant(32)
b = tf.constant(2)
x = tf.add(a,b)

with tf.Session() as sess:
    print(sess.run(x))

輸出:
34

大功告成!

相關推薦

tensorflow執行提示編譯使用SSE4.1SSE4.2問題的解決方法

問題描述 每次執行TensorFlow 程式時,總是會提示未編譯使用SSE4.1,SSE4.2等warnings 警告。 import tensorflow as tf a = tf.constant(32) b = tf.constant(2) x =

tensorflow提示編譯使用SSE4.1SSE4.2問題的解決方法

先概述下問題:之前是在終端中使用 pip install tensorflow==1.1.0 命令來完成安裝的,在eclipse中能夠執行,但是卻會提示報錯,在控制檯輸出一串未使用SSE4.1,SSE4,2等字樣的資訊,本人有強迫症無法容忍專案中各種報錯提示的存在,然後花了

windows wamp執行提示 Fatal error: Call to undefined function curl_init的解決方法

windows作業系統安裝好WAMP後執行程式提示: fatal error: call to undefined function curl_init() 錯誤 出現這個錯誤提示的原因是curl模組沒有啟用, 解決辦法如下: 找到PHP的配置檔案php.ini, L:wampbinphpphp5.4

部署IIS時提示訪問.NETFRAMEWORK檔案時拒絕訪問的解決方法

CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e61851bc\5bd4696b\Ap

Linux執行.sh檔案提示No such file or directory的問題的解決方法

今天遇到了個奇怪的問題,就是再linux中執行shell 死活載入不到/etc/profile 直接執行source  /etc/profile 沒問題 但是在shell中執行就不行 查詢

Mac High Sierra 編譯Android7.18.1原始碼填坑記錄

在這裡記錄一下在Mac High Sierra編譯Android7.1以後原始碼出現的坑以及解決方法. 坑1: 編譯Android 7.1出現 [ 1% 629/33105] Yacc: aidl <= system/tools/aidl/

專案執行提示無法找到除錯資訊或者除錯資訊不匹配解決辦法

      偶然一次VS執行C++專案時出現瞭如下問題,現記錄解決辦法。      解決辦法:     首先開啟選單 專案->專案屬性頁       1. 選擇 配置屬性->連結器->除錯->生成除錯資訊 改為 是       2. 選擇 配置屬性

Linux執行.sh文件,提示No such file or directory的問題的解決方法

感謝 文件格式 很多 兼容 dir shell nbsp www window平臺 Linux執行.sh文件,提示No such file or directory的問題在window平臺下,寫好shell腳本文件,遷移到linux平臺,賦過可執行權限,執行該sh文件,卻提

Win10提示“您連接到nvidia gpu的顯示器”的解決方法

芯片 mic ati 顯示 sco 輸入 損壞 upload nvidia 發布時間:2017-08-14 09:53發布者:系統城-小群瀏覽數:37102 顯卡有Nvidia 和 ATI兩個芯片,我們經常稱他們為N卡和A卡,N卡更加註重於性能,而A卡則為顏色艷麗,畫

人工智能從0到1快速入門的學習方法

enter apt -i 到來 一點 去年 結合 需要 處理器 人工智能的核心就是機器學習(Machine Learning),它是使計算機具有智能的根本途徑,其應用遍及人工智能的各個領域。機器學習屬於計算機科學與統計學的交叉學科,在多個領域會以不同的面目出現,比如

Problem H: 計算數列和2/13/25/38/5......

#include<stdio.h> int main(){ int i,n; scanf("%d",&n); float sum=0.0; float a=1; float b=2; for(i=1;i<=n;i++){

使用Netbeans編譯C++檔案動態連結庫的方法

一鍵執行時會出現類似於下面的錯誤: Undefined symbols for architecture x86_64:   "___gmp_printf", referenced from:       _main in main.o   "_

如何實現多執行緒?實現多執行緒為什麼要調start而不是run方法?(繼承Thread類、實現Ruable介面、Callable<V>)

什麼是程序? 作業系統中一個程式的執行週期(從開啟到關閉)。程序是具有一個或多個執行緒的執行緒組。 什麼是執行緒? 一個程序可以同時執行多個任務,任務就是執行緒,一個程序至少有一個執行緒。 執行緒執行在程序內部,執行緒是輕量級程序。 程序和執行緒比較:

Centos7 安裝完畢後重啟提示 Initial setup of CentOS Linux 7 (core) 的解決方法

問題: Centos7 安裝完畢後,重新開機啟動後顯示 Initial setup of CentOS Linux 7 (core) 1)[x] Creat user 2)[!]License information (no user will be created)(license

loadrunner執行場景時常見錯誤及解決方法

目錄   1、Error -27727:.3 2、Error -27728:.3 3、Error -27791:.3 4、Error -27492:.4 5、Error -27498:.4 6、Error -26612:.4

Python執行以及多執行緒帶來的資料錯亂和死鎖的解決方法

摘至本人有道雲筆記《Python執行緒》 1.python多執行緒的建立 在Python中,同樣可以實現多執行緒,有兩個標準模組thread和threading,不過我們主要使用更高階的threading模組 threading模組提供的類:      Thread,

給定一個正整數k(3≤k≤15),把所有k的方冪及所有有限個互不相等的k的方冪之和構成一個遞增的序列例如當k=3時這個序列是: 1,349101213… (該序列實際上就是:3^03^1,3^0+3^1,3^2,3^0+3^2,3^1+3^2,3^0+3^1+3^2,…) 請你求

只有1行,為2個正整數,用一個空格隔開: k N (k、N的含義與上述的問題描述一致,且3≤k≤15,10≤N≤1000)。  計算結果,是一個正整數(在所有的測試資料中,結果均不超過2.1*10^9)。(整數前不要有空格和其他符號)。 #include<stdio.h> int

ibatis/mybatis出現 sql 語句 where in(引數1引數2……引數1000) 超過1000個引數時候的解決方案

公司專案出現bug,查詢後是由於sql 語句in()內參數查過1000引起的 由於專案比較大,無法輕易修改或重構。 公司框架比較老用了ibates  無法從xml配置裡進行修改。所以本人寫了段程式碼

CCF CSP2018年九月前兩題實現(python201809-1201809-2

第一題: 這道題還是很容易解決的,一些初學者或者粗心的人需要注意問題所提示的第一個和最後一個數在長度為n的數組裡面分別對應0和n-1。另外,就是CCF CSP要求的標準輸出,是要和樣例一樣的。 下面是

linux的crontab裡面保證最多執行一個程序/兩個程序/多個程序的解決方法

在linux的crontab裡面,保證最多執行一個程序/兩個程序/多個程序 這個多謝了老大的推薦。我解決了flock來解決crontab裡面,即使系統卡住,也最多執行兩個程序的問題。 flock 會去判斷根據一個鎖檔案去判斷程序有沒有在執行。如果在執行,後面的程序就得等待。 fl