win10+anaconda3+tensorflow+gpu

来源:互联网 发布:京东淘宝衣柜 编辑:程序博客网 时间:2024/05/16 11:19

尝试了一下win10下GPU版本的tensorfl安装。

官方安装(windows)

1.首先安装anaconda3,这个问题不大,照着来就行了。

anaconda下载

2.安装cuda8.0

cuda8下载

选择合适自己的版本,我这里是win10,所以选择如下。建议选择完整的exe[local]下载,network版本不稳定。


安装cuda8时可能会出现如下警告

"This graphics driver could not find compatible graphics hardware. You may
continue installation. but you may not be able to run CUDA applications with this
driver. This may occur with graphics hardware that is newer than this toolkit. In
that case, it is suggested that you keep your existing driver and install the
remaining portions of the CUDA Toolkit."

这里说明一下,我的显卡是1050TI,虽然在官网的支持列表上看不到(可能这个产品较新),但是使用GPU-Z检测是支持CUDA8的,因此继续安装,但是勾选高级安装

并且不要覆盖原来的显卡驱动程序以及另外的physx驱动。然后会提示你需要安装vs2015,否则一些组件不能使用。其实不做GPU开发是不需要用到这个的,因此

继续安装,安装成功后,除了自动新增的CUDA等系统变量,还需要在系统变量Path增加两个路径,即CUDA的主目录下的bin和lib目录(我的CUDA安装在D:\cuda8\tookit)。



3. 下载解压cuDNN

cuDNN下载

解压后把里面的bin还有lib放到CUDA的lib和bin


4. 接下来就是官网的中的安装步骤


创建tensorflow环境

C:> conda create -n tensorflow python=3.5
激活tensorflow环境

C:> activate tensorflow (tensorflow)C:>  # Your prompt should change 
安装GPU加速的tensorflow

(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu 
运行官网样例,出现以下消息:





说明GPU加速启动,第一行的提示:

The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine

说明从源码直接build tensorflow 的CPU计算的速度会更快一点(因为通过pip安装的是别人预先编译的版本,没有针对机器配置进行优化),

对于像我这种仅仅是想学习/体验一下tensorflow的同学,可以先不管,tensorflow所有该有的东西都会有,无须担心。

google此行提示,或者看看这个如何使用AVX来编译tensorflow的帖子点我

原创粉丝点击