win10下安装cuda8.0+cudnn6.0+tensorflow1.3-GPU+python3.5

怎甘沉沦 提交于 2019-12-03 08:24:55

1.安装Anaconda

在官网下载的Anaconda3-4.4.0-Windows-x86_64.exe.(对应64位系统)
在这里插入图片描述

下一步高级安装选项里面勾选上面加入环境变量,下面不选
在这里插入图片描述

2安装tensorflow

管理员身份启动anaconda prompt依次执行下面命令。
用anaconda创建一个虚拟环境

conda create -n tensorflow python=3.5

添加清华的镜像源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

activate tensorflow , 进入TensorFlow环境

 pip install --upgrade --ignore-installed tensorflow-gpu

安装TensorFlow指定版本(清华源上有的,更换链接最后的版本名称就行了)
pip install --upgrade

https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/gpu/tensorflow_gpu-1.3.0rc0-cp35-cp35m-win_amd64.whl

3安装CUDA

nvidia官网下载win10版的64位CUDA程序,安装步骤安装后在系统中添加环境变量
在这里插入图片描述

4安装CUDNN

把解压文件放置到CUDA的相关文件夹里

在这里插入图片描述
把上面的三个文件放到CUDA文件中
在这里插入图片描述

5简单测试:

import tensorflow as tf
hello = tf.constant("Hello!TensorFlow")
sess = tf.Session()
print(sess.run(hello))

在这里插入图片描述

如果说明没有报错说明以及安装好了

#安装过程中的注意事项
安装的过程中一定注意版本的匹配
出现报错导入错误
先定位错误

import numpy as np

出错说明numpy安装包出现错误
这时候需要重新的安装numpy包

pip uninstall numpy
pip install numpy

当出现python的版本不匹配的时候
先查看版本

 python --version
conda install python==3.5

进入虚拟环境

 activate tensorflow

退出虚拟环境

 deactivate

参考博客
(https://blog.csdn.net/albert201605/article/details/79090620/)
(https://www.cnblogs.com/hear-nothing/p/7464882.html)
(https://blog.csdn.net/gangeqian2/article/details/79358543)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!