Win7:Your CPU supports instructions that this Tensorflow binary was not compiled to use:AVX AVX2

错误为:Your CPU supports instructions that this Tensorflow binary was not compiled to use:AVX AVX2

不支持,就卸载,换一个呗

错误是这么出现的:

在我测试自己安装的Tensorflow是否有问题时:打开cmd输入python,进入Python界面,输入指令import tensorflow as tf,未出现错误。然后用一个简单的小程序测试一下:输入指令如下:(小程序参考博客:https://blog.****.net/sunxiaoju/article/details/79025033

Win7:Your CPU supports instructions that this Tensorflow binary was not compiled to use:AVX AVX2

显示图中错误,这是因为电脑配置和安装的Tensorflow版本无法协调导致的,下载TensorFlow的版本不支持cpu的AVX2编译。为了彻底解决这一问题,可以将Tensorflow换成支持cpu用AVX2编译的版本。

卸载当前版本:

首先卸载之前的tensorflow版本。在安装目录下(按shift+右键)输入指令 pip uninstall tensorflow,卸载tensorflow库,然后下载正确的版本。Windows网址:https://github.com/fo40225/tensorflow-windows-wheel,我选的是下面这个:

Win7:Your CPU supports instructions that this Tensorflow binary was not compiled to use:AVX AVX2

然后在下载目录下打开命令窗口,输入对应的指令安装tensorflow:

Win7:Your CPU supports instructions that this Tensorflow binary was not compiled to use:AVX AVX2

安装成功:

Win7:Your CPU supports instructions that this Tensorflow binary was not compiled to use:AVX AVX2

多注意安装地址,可以避免很多错误。

然后继续我们的小程序测试:(参考博客:https://blog.****.net/sunxiaoju/article/details/79025033

Win7:Your CPU supports instructions that this Tensorflow binary was not compiled to use:AVX AVX2

注意print后面应该加括号。

Tensorflow就可以正常使用啦!