Your CPU supports instructions that this TensorFlow binary was not compiled to use

安装tensor flow 运行程序,出现2行警告

2019-05-14 10:10:59.316018: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2019-05-14 10:10:59.316183: I tensorflow/core/common_runtime/process_util.cc:71] Creating new thread pool with default inter op setting: 4. Tune using inter_op_parallelism_threads for best performance.

原因:
大概意思是:你的CPU支持AVX扩展,但是你安装的TensorFlow版本无法编译使用。除了通常的算术和逻辑,现代CPU提供了许多低级指令,称为扩展,例如, SSE2,SSE4,AVX。如果你的是gpu,则可以忽略这个问题。

解决方案
(1)警告直接忽略
在程序开头加入

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

(2)源头上解决
重新安装tensor flow。换成支持cpu用AVX2编译的TensorFlow版本。

参考:https://blog.csdn.net/Fourierrr_/article/details/79749899

发布了46 篇原创文章 · 获赞 9 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_43826596/article/details/90201463