win10系统anaconda搭建tensorflow环境(踩坑24小时完整解决攻略)

0、相关说明及anaconda下载安装

0.1:

anaconda版本3-4.3.0

0.2:

遇到的问题:

PermissionError: [Errno 13] Permission denied: 'C:\\ProgramData\\Anaconda3\\

tensorflow安装时显示:多个安装失败

0.3:

anaconda下载地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

 0.4:效果截图

1、win10获取管理员权限:
将用户的账户类型设置为管理员:打开控制面板-用户账号-更改账户类型-选择管理员
进入anaconda的安装文件夹:C:\ProgramData\Anaconda3,右键点击授予访问权限。然后打开Anaconda Prompt即可。
或者直接cmd切换到anaconda的安装路径:C:\ProgramData\Anaconda3
不这样操作会产生错误:PermissionError: [Errno 13] Permission denied: 'C:\\ProgramData\\Anaconda3\\
2、
查看conda包信息
conda list
查看conda版本
conda -V
3、为了防止Anaconda Navigator第一次无法打开,先设置国内的清华大学镜像
由于国内访问国外网站速度相当慢,很有可能安装一些库安装不成功,因此需要置国内镜像源地址
增加清华大学镜像源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
删除默认镜像源:
conda config --remove channels defaults
查看配置信息:
conda config --show
验证源:
conda search tensorflow
4、
安装tensorflow
安装的anaconda版本为:4.3.8  Anaconda3-4.3.0-Windows-x86_64
在anaconda Navigator 中,搜索安装tensorflow,tensorflow版本为 1.12.0
不到一分钟安装完成。
5、
下面测试tensorflow环境

(C:\ProgramData\Anaconda3) C:\Users\xxx>python.exe
Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('Hello,Tensorflow!')
>>> sess = tf.Session()
2018-12-01 16:35:46.385921: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2018-12-01 16:35:46.392792: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2018-12-01 16:35:46.397187: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2018-12-01 16:35:46.401043: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2018-12-01 16:35:46.406450: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2018-12-01 16:35:46.410500: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2018-12-01 16:35:46.414409: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-12-01 16:35:46.420305: W c:\l\tensorflow_1501918863922\work\tensorflow-1.2.1\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
>>> sess.run(hello)
b'Hello,Tensorflow!'


6、
以上,被anaconda折磨了16+小时,24小时内安装卸载超过15次,踩过的坑贡献给无私的互联网参考。
安装日期2018.12.01,windows10家庭版,亲测有效。

参考文献:

http://www.cnblogs.com/xiaojianliu/p/9490661.html

http://blog.51cto.com/m51cto/2161697?source=dra

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值