解决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