当前位置:首页 >> 半导体技术突破 >> 【TensorFlow】Win7+Anaconda+python3.6+Tensorflow1.9安装教程,索爱j100c

【TensorFlow】Win7+Anaconda+python3.6+Tensorflow1.9安装教程,索爱j100c

cpugpu芯片开发光刻机 半导体技术突破 3
文件名:【TensorFlow】Win7+Anaconda+python3.6+Tensorflow1.9安装教程,索爱j100c 【TensorFlow】Win7+Anaconda+python3.6+Tensorflow1.9安装教程 相关链接

官网:https://tensorflow.google.cn/ github:https://github.com/tensorflow/tensorflow 中文社区网:http://www.tensorfly.cn/

安装说明

平台:windows 7 Anaconda版本:4.6.14 python版本:3.6.9 numpy版本:1.16.0 版本:tensorflow-1.9.0-cp36-cp36m-win_amd64.whl (cpu版本) 阿里云镜像下载:http://mirrors.aliyun.com/pypi/simple/tensorflow/                 http://mirrors.aliyun.com/pypi/simple/tensorflow-cpu/

安装方式:pip

1. 安装环境 Tensorflow1.9.0的CPU版本环境需求简单,安装比较简洁。 TensorFlow是基于VC++2015开发的,所以需要下载安装VisualC++ Redistributable for Visual Studio 2015 来获取MSVCP140.DLL的支持。2. 安装过程 anaconda安装 conda --version           -->检查anaconda安装版本 conda info --envs         -->检测已经安装的环境3. 创建虚拟环境 conda create --name tensorflow python=3.6     -->创建一个名字为tensorflow,python3.6的虚拟环境4. 激活虚拟环境 activate tensorflow

5. 安装tensorflow pip install tensorflow

6.安装完后通过import tensorflow查看是否报错,没报错说明安装成功

7. 查看tensorflow版本  import tensorflow as tf    tf.__version__

使用当中发现,会报错“that this TensorFlow binary was not compiled to use: AVX AVX2”

那就需要换成支持cpu用AVX2编译的TensorFlow版本

https://github.com/fo40225/tensorflow-windows-wheel/tree/master/2.0.0/py37/CPU/avx2

常见问题:

1. 提示FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)])

由于numpy1-17-0版本过高,使用numpy-1.16-0版本即可

先删除旧版本再安装新版本:

pip uninstall numpypip install -i https://mirrors.aliyun.com/pypi/simple/ numpy==1.16.0

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

简单的解决办法>不再提示:   直接在py文件开头 

import os # 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

这其实是电脑CPU的错,因为电脑CPU太垃圾了。

3. conda create --name tensorflow python=3.6 创建虚拟环境时报错

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json> Elapsed: -

解决方法如下

cmd输入conda config --add channels r

然后进入C:\Users\你的用户名,找到.condarc文件

修改如下:

channels:   - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ ssl_verify: true show_channel_urls: true

保存后就可以创建虚拟环境了。

协助本站SEO优化一下,谢谢!
关键词不能为空
同类推荐
«    2025年12月    »
1234567
891011121314
15161718192021
22232425262728
293031
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接