I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this Tensor

问题:在使用tensorflow的时候由于版本不匹配问题导致不能编译

I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

解决方案:

如果没有太大的计算量,可以尝试在程序的开始处添加代码:

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
1
2
3
2. 如果需要对CPU进行优化,可以访问下面的github,重新编译tensorflow源码以兼容AVX
https://github.com/lakshayg/tensorflow-build

你可能感兴趣的:(tensorflow,python,深度学习)