**

避坑必读,强烈建议

1.说明你电脑支持AVX2,而你的tesorflow版本不支持,重建虚拟环境重装tensorflow
2.离线安装tensorflow,下载安装包之后再安装
3.如果遇到新问题,请认真看提示,不要乱百度!!!

这几步需要前提准备:

准备1下载安装Anaconda3

访问清华镜像下载:https://mirrors.tuna.tsinghua.edu.cn/
安装时,全程点击"下一步",完成即可
注:也可以参考其他任何教程,假设安装路径为 G:\Anaconda3
注:本节使用Anaconda3-5.1.0-Windows-x86_64.exe(对应我电脑系统win10-(64位)版)

准备2:创建虚拟环境tf1

使用管理员身份打开Anaconda Prompt,创建虚拟环境tf1(注意本次python版本3.6.0,tf1可以自行定义)
conda create --name tf1 python=3.6.0

安装Tensorflow正式开始

  • 1.访问这个镜像网址下载tensorflow
    https://gitcode.net/mirrors/fo40225/tensorflow-windows-wheel/
    根据需求下载,本节测试对应python6.3.0的版本tensorflow-1.4.0-cp36-cp36m-win_amd64.whl
  • 2. 在Anaconda中创建文件夹存放
    G:\Anaconda3\Lib\tensor(Lib下的路径自己创建),将下载文件复制拷贝到该文件中
  • 3.切换到虚拟环境tf1
    管理员身份打开Anaconda Prompt,切换到对应的虚拟环境tf1下:
    env list #查看虚拟环境
    conda activate tf1
  • 4.跳转目录
    跳转到G:\Anaconda3\Lib\tensor 目录中
    G: (回车)
    cd Anaconda3\Lib\tensor\
  • 5.安装离线的ensorflow
    在tf1环境下,安装离线的文件
    pip install tensorflow-1.4.0-cp36-cp36m-win_amd64.whl
  • 6. 在tf1环境下测试通过python导入tensorflow
    在Anaconda Prompt中 tf1虚拟环境下执行:
    python (回车)
    import tensorflow as tf #导入tensorflow
    print(tf.version) #打印tensorflow 版本
    print( tf.path ) #打印tensorflow 路径
  • 7.安装jupyter notebook
    (推荐使用)conda install jupyter notebook
  • 8.在tf1环境下安装ipykernel
    jupyter kernelspec list #查看tf1环境下jupyter所有可用的 kernels
    upyter kernelspec remove 名称 (名称为你想删除的现有名称)
    pip install ipykernel
    python -m ipykernel install --name tf1
  • 9. 在tf1环境下测试通过jupyter notebook导入tensorflow
    jupyter notebook
    网页自动打开后,New–>ft1,然后写入程序
    import tensorflow as tf
    print(tf.version)
    print( tf.path )

遇到其他问题解决办法

  • 【1】如果出现:ImportError: cannot import name ‘AsyncGenerator’,
    请关闭所有juppyter notebook和窗口重新打开,然后激活tf1的环境 ,再执行:
    python -m ipykernel install --name tf1

  • 【2】如果需要使用:matplotlib,请独立安装下载好的安装包

  • **下载后安装:matplotlib-2.2.5-cp36-cp36m-win_amd64.whl
    cp36代表的是python的版本,如python3.6.0就是cp36
    win_amd64指的是windows系统(64位)
    选择自己对应的matplotlib(其他模块也一样),下载到scripts目录下。
    打开cmd,输入cd ×××/×××/×××/scripts(你的scripts路径)
    然后用pip下载whl文件,
    pip install matplotlib-2.2.5-cp36-cp36m-win_amd64.whl
    因为,你按照上述方法安装完后请看一下自己的numpy版本=1.19.5
    如果直接使用pip install matplotlib指令,会下载其他支持库,其中有一个为numpy=1.13.1,这样就会出错。所以还是先下载好独立安装包,然后再pip安装。
    但是这样,导入时还会出现一个新错误
    ‘version_info’ object has no attribute ‘version
    不要怕
    打开以下文件:G:\Anaconda3\envs\tf1\Lib\site-packages\pyparsing,下的__init__.py文件
    init.py 对应位置(这一段)

class version_info(NamedTuple):major: intminor: intmicro: intreleaselevel: strserial: int@propertydef __version__(self):return "{}.{}.{}".format(self.major, self.minor, self.micro) + ("{}{}{}".format("r" if self.releaselevel[0] == "c" else "",self.releaselevel[0],self.serial,),"",)[self.releaselevel == "final"]def __str__(self):return "{} {} / {}".format(__name__, self.__version__, __version_time__)def __repr__(self):return "{}.{}({})".format(__name__,type(self).__name__,", ".join("{}={!r}".format(*nv) for nv in zip(self._fields, self)),)

init.py 修改后

def __init__(self,major:int,minor:int,micro:int,releaselevel:str,serial:int):   self.major = majorself.minor = minorself.micro = microself.releaselevel = releaselevelself.serial = serial
@property
def __version__(self):return "{}.{}.{}".format(self.major, self.minor, self.micro) + ("{}{}{}".format("r" if self.releaselevel[0] == "c" else "",self.releaselevel[0],self.serial,),"",)[self.releaselevel == "final"]
def __str__(self):return "{} {} / {}".format(__name__, self.__version__, __version_time__)
def __repr__(self):return "{}.{}({})".format(__name__,type(self).__name__,", ".join("{}={!r}".format(*nv) for nv in zip(self._fields, self)),)

写在最后

如果有时间可以看看,python与tensorflow对应的版本
https://gitcode.net/mirrors/fo40225/tensorflow-windows-wheel/#tensorflow-windows-wheel

如果还是有其他问题,请耐心看错误提示。实在解决不了,就请留言吧,我们一起解决。

安装完后

(tf1) C:\Users\Administrator>conda list

packages in environment at G:\Anaconda3\envs\tf1:

Name Version Build Channel

bleach 1.5.0 pypi_0 pypi
certifi 2016.2.28 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
colorama 0.3.9 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
dataclasses 0.8 pypi_0 pypi
decorator 4.1.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
entrypoints 0.2.3 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
enum34 1.1.10 pypi_0 pypi
html5lib 0.9999999 pypi_0 pypi
icu 57.1 vc14_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
importlib-metadata 4.8.3 pypi_0 pypi
ipykernel 4.6.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
ipython 6.1.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
ipython_genutils 0.2.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
ipywidgets 6.0.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jedi 0.10.2 py36_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jinja2 2.9.6 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jpeg 9b vc14_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jsonschema 2.6.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jupyter 1.0.0 py36_3 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jupyter_client 5.1.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jupyter_console 5.2.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
jupyter_core 4.3.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
libpng 1.6.30 vc14_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
markdown 3.3.7 pypi_0 pypi
markupsafe 1.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
mistune 0.7.4 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
nbconvert 5.2.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
nbformat 4.4.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
notebook 5.0.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
numpy 1.19.5 pypi_0 pypi
openssl 1.0.2l vc14_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pandocfilters 1.4.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
path.py 10.3.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pickleshare 0.7.4 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pip 9.0.1 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
prompt_toolkit 1.0.15 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
protobuf 3.19.6 pypi_0 pypi
pygments 2.2.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pyqt 5.6.0 py36_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
python 3.6.0 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
python-dateutil 2.6.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
pyzmq 16.0.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
qt 5.6.2 vc14_6 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
qtconsole 4.3.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
setuptools 36.4.0 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
simplegeneric 0.8.1 py36_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
sip 4.18 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
six 1.16.0 pypi_0 pypi
tensorflow 1.4.0 pypi_0 pypi
tensorflow-tensorboard 0.4.0 pypi_0 pypi
testpath 0.3.1 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
tornado 4.5.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
traitlets 4.3.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
typing-extensions 4.1.1 pypi_0 pypi
vc 14 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
vs2015_runtime 14.0.25420 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
wcwidth 0.1.7 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
werkzeug 2.0.3 pypi_0 pypi
wheel 0.29.0 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
widgetsnbextension 3.0.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
wincertstore 0.2 py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
zipp 3.6.0 pypi_0 pypi
zlib 1.2.11 vc14_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

成功解决Your CPU supports instructions that this TensorFlow binary was not compiled to use AVX AVX2相关推荐

  1. 成功解决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(二) ...

  2. 成功解决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 目录 ...

  3. Your CPU supports instructions that this TensorFlow binary was not compiled to use AVX AVX2

    大致的原因就是说:tensorflow觉得你电脑cpu还行,支持AVX(Advanced Vector Extensions),运算速度还可以提升,所以可以开启更好更快的模式,但是你现在用的模式相对来 ...

  4. 彻底解决“Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA”警告

    问题描述 在使用TensorFlow时,总是提醒"Your CPU supports instructions that this TensorFlow binary was not com ...

  5. tensorflow:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

    ps:这跳出的是一个cpu警告,但我用的是gpu啊!!即使我安装合适版本的(编译过的)tensorflow来满足我cpu的AVX2扩展,也还是没对我的运行速度有太大提高(猜测),所以如果你是使用gpu ...

  6. Tensorflow警告:our CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

    使用TensorFlow模块时,弹出错误Your CPU supports instructions that this TensorFlow binary was not compiled to u ...

  7. 去除警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

    去除警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 文章 ...

  8. 警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA(亲测)

    警告:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 转载:h ...

  9. Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2问题解决

    tensorflow运行遇到的问题: Your CPU supports instructions that this TensorFlow binary was not compiled to us ...

最新文章

  1. 《XNA高级编程:Xbox 360和Windows》1-1
  2. 合并多个excel——贼快
  3. 消费者版 Vive Trackers 正式发布,只会与 Steam 1.0 基站适配
  4. Error creating bean with name 'adminUserController': Injection of autowired dependencies failed;
  5. Java8 拼接字符串 StringJoiner
  6. 浅析网络编程之Socket模型
  7. Scrapy爬虫抓取ZOL手机详情
  8. ffmpeg命令解析
  9. 车牌识别sdk android,Android车牌识别sdk
  10. 【Python程序设计(七)】文件和数据格式化
  11. Unity任意版本Vuforia插件下载
  12. 一个周末掌握IT前沿技术之node.js篇一:Node.js与javascript
  13. java编程题代做,代做COMP 2406作业、代写Java语言作业、代做programming作业、代写Java程序实验作业...
  14. Pandas —— Periods(周期)的创建、运算及转换
  15. [转]AndroidTolls国内镜像
  16. 在手机与计算机之间进行文件传输的方式,电脑与手机快速传输文件的方法
  17. ambarella misc
  18. 历史上十大著名思想实验
  19. 聊一聊安全且正确使用缓存的那些事 —— 关于缓存可靠性、关乎数据一致性
  20. html 实体编码转换成原字符

热门文章

  1. Android Canvas类
  2. java计算机毕业设计学生管理系统MyBatis+系统+LW文档+源码+调试部署
  3. 融合收敛因子和樽海鞘群的蝴蝶优化算法
  4. 【华为机试题HJ86】求最大连续bit数
  5. Fedora14 Samba 配置
  6. tcl计算机语言,Vivado之TCL脚本语言基本语法介绍
  7. ASP.NET Web API与Owin OAuth:使用Access Toke调用受保护的API(二)
  8. OpenCV安装及其开发环境配置(C++)
  9. linux ftp搭建及多端口监听
  10. 2023最新SSM计算机毕业设计选题大全(附源码+LW)之java疫情防控管理系统02vsf