解決tensorflow的"Your CPU supports instructions that this TensorFlow binary was not compiled to use: AV

問題描述

程序開始運行的時候報出警告:
I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMAthis

 

解決方法

加入下面兩行代碼,忽略警告:spa

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

 

說明:.net

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

 

參考:
https://blog.csdn.net/hq86937375/article/details/79696023
https://blog.csdn.net/qq_41185868/article/details/79127838code

相關文章
相關標籤/搜索