解决“Your CPU supports instructions that this TensorFlow binary was not compiled to use AVX2”
pip install tensorflow
直接安装的包过于通用,在现在大部分电脑上都会报“Your CPU supports instructions that this TensorFlow binary was not compiled to use AVX2”
解决方案:
-
命令行执行:
pip uninstall tensorflow
-
到https://github.com/fo40225/tensorflow-windows-wheel(Windows)或https://github.com/lakshayg/tensorflow-build (MacOS and Linux)下载编译好的指定使用AVX2指令集的whl文件
因Github下载速度较慢,博主准备了最通用的tensorflow-2.0.0-cp37-cp37m-win_amd64.whl(Windows CPU版 Python3.7)
CSDN下载链接 -
找到
tensorflow.whl
存放路径,命令行下切到该路径,执行:pip install tensorflow-2.0.0-cp37-cp37m-win_amd64.whl
(自己下载的文件全名)
Tip:输入tensor后按Tab
键可自动补全
另外还没有把pip源改为国内镜像的同学可以先看下面这篇文章https://blog.csdn.net/qq_43526642/article/details/97617950