解決tensorflow的"Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA Using TensorFlow backend."警告問題


問題描述

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

 

解決方法

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

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

 

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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM