脚本专栏 
首页 > 脚本专栏 > 浏览文章

tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T

(编辑:jimmy 日期: 2024/10/21 浏览:3 次 )

遇到了这个问题,意思是你的 CPU 支持AVX AVX2 (可以加速CPU计算),但你安装的 TensorFlow 版本不支持

tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T

解决:1. 如果是初学者 或者 没有太大计算速度的需求,在开头加上这两行忽略这个提示即可

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

2. 如果需要对CPU进行优化,可以访问下面的github,重新编译tensorflow源码以兼容AVX

https://github.com/lakshayg/tensorflow-build

总结

上一篇:Python ckeditor富文本编辑器代码实例解析
下一篇:keras做CNN的训练误差loss的下降操作