今天在Windows 10 / Anaconda 3.5下面装了Tensorflow1.2。
其实安装主要就是参考官方文档
https://www.tensorflow.org/install/install_windows
我试了在python3.6下安装,结果失败了。
还是老老实实的按照官方说明去装吧。
其中,cudnn的安装方法是将cudnn下面的三个文件夹(bin,include, lib)复制到cuda 8.0文件夹。我的文件夹地址是
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0
还有,这句命令执行的时候,是不需要翻墙的。我一开始看到url里面有google,想都没想就翻墙了。运行了半天,后来VPN掉了,发现不影响这句命令。ps:装个tensorflow,一会翻墙,一会断VPN,搞得我很憔悴。
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.2.0-cp35-cp35m-win_amd64.whl
装完以后运行,出现以下错误:
ImportError: No module named '_pywrap_tensorflow_internal'
ImportError: DLL load failed: The specified module could not be found.
Google了一圈,发现解决的办法是把cudnn64_6.dll改名为cudnn64_5.dll。网上是这样解释的
TensorFlow requires “cuDNN v5.1” but if you install cuDNN v6.0, then the file name of the cudnn dll file will be cudnn64_6.dll not cudnn64_5.dll.
再运行tensorflow,成功。