1. 程式人生 > 程式設計 >tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T

tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T

遇到了這個問題,意思是你的 CPU 支援AVX AVX2 (可以加速CPU計算),但你安裝的 TensorFlow 版本不支援

這裡寫圖片描述

解決:1. 如果是初學者 或者 沒有太大計算速度的需求,在開頭加上這兩行忽略這個提示即可

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

說明:

os.environ["TF_CPP_MIN_LOG_LEVEL"] = '1' # 預設,顯示所有資訊
os.environ["TF_CPP_MIN_LOG_LEVEL"] = '2' # 只顯示 warning 和 Error
os.environ["TF_CPP_MIN_LOG_LEVEL"] = '3' # 只顯示 Error

2. 如果需要對CPU進行優化,可以訪問下面的github,重新編譯tensorflow原始碼以相容AVX

https://github.com/lakshayg/tensorflow-build

總結

到此這篇關於I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T的文章就介紹到這了,更多相關I tensorflow/core/platform/cpu_feature_guard.cc:140]內容請搜尋我們以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援我們!