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

参考

https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this-tensorflow-binary-was-not-compiled-to-u?answertab=votes#tab-top

意思是 你电脑的CPU支持AVX2指令,但是你当前使用的TensorFlow二进制版本编译的时候并没有使用这种AVX2指令。

解决方案

一、如果安装的是GPU版本

在文件顶部添加下面代码,直接忽略,不会产生不良影响。

import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"

2.如果TensorFlow是CPU版本

2.1从源码开始编译安装适合自己笔记本CPU的TensorFlow

2.2在文件顶部添加下面代码,直接忽略,相较于2.1性能上可能会差一点,但无伤大雅。

import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"

猜你喜欢

转载自blog.csdn.net/csdn_zhishui/article/details/83097300