報錯解決——Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2


  

  在導入tensorflow后,進行運算時,出現了報錯Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

解決方法

  在最頂行寫入以下代碼即可

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

 

參考資料:Advanced Vector Extensions 

import os  
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  
View Code

 


免責聲明!

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



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