跑簡單tf例程的時候遇到這個
sess = tf.Session(),I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX,
為什么會出現這個問題?
為了提升CPU計算速度的。若你有支持cuda的GPU,則可以忽略這個問題,因為安裝SSE4.1, SSE4.2, AVX, AVX2, FMA, 僅僅提升CPU的運算速度(大概有3倍)。
解決方法:
-
忽視警告,並屏蔽警告
開頭輸入如下:
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
2.進 tensorflow 官網,從源碼安裝。
https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this-tensorflow-binary-was-not-compiled-to-u?answertab=votes#tab-top

需要bazel工具進行源碼安裝
