首页 > 编程语言 > tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T
2020
10-08

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

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

这里写图片描述

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

总结

到此这篇关于I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this T的文章就介绍到这了,更多相关I tensorflow/core/platform/cpu_feature_guard.cc:140]内容请搜索自学编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持自学编程网!

编程技巧