Anaconda+CUDA+CUDNN+Tensorflow在Win10上安装总结

前言

今年实验室配了两个2万+的设备,显卡Quardo M4000 8G 很强了。我之前还用tensorflow cpu 训练数据,慢的我都怀疑人生了。于是便安装了gpu版本。速度66的。
本文是在Win10环境下安装Anaconda3 5.0.1(64-bit),CUDA8.0,CUDNN-8.0-windows10-x64-v6.0,看了好多文章,折腾了差不多一下午和一晚上,发现这篇文章总结的比较全面,但还是有其他的问题。

问题一

CUDA的环境变量的设置:
在环境变量Path加入一下三个,第一个很重要(很多网站都忽略了!!!)

  1. %CUDA_PATH%\extras\CUPTI\libx64;
  2. %CUDA_PATH%\bin;
  3. %CUDA_PATH%\lib\x64;

问题二

对于CUDNN的安装,详见文章《如何安装CUDNN》,已经介绍的很清楚了。

问题三

Win10,ANACONDA3(64-bit),Python3.6.2。ANACONDA Prompt中不能用pip命令安装包,并且是在安装了TensorFlow后才发生的。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Exception:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_set.py", line 554, in _prepare_file
require_hashes
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 731, in __init__
namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument 'transport_encoding'

解决办法:
输入conda install -c anaconda html5lib
等待执行完后,发现pip安装指令可以成功执行。
这个问题参考文章点这里

您的支持将鼓励我努力创作!