win 10はtensorflow 1をインストールする.5+CUDA9.0+cuDNN7.1+anaconda3+python3.6.3

7497 ワード

tensorflow公式サイトのチュートリアルは古いバージョンですが、https://www.tensorflow.org/install/install_windows,
Ensure you meet the following requirements before you install cuDNN.
A GPU of compute capability 3.0 or higher. To understand the compute capability of the GPU on your system, see: CUDA GPUs.
One of the following supported platforms:
Windows 7
Windows 10
One of the following supported CUDA versions and NVIDIA graphics driver:
**NVIDIA graphics driver 377.55 or newer for CUDA 8**
**NVIDIA graphics driver 385.54 or newer for CUDA 9**

インストール前にGPUがあることを確認し、CUDAバージョン対応のグラフィックスドライバを更新し、最新のものをインストールする必要がなく、要求を満たす安定したバージョンを選択します.
本機64-bit,x 86の実装用はCUDA 9である.0(注意現在tensorflow 1.5はCUDA 9.0にしか適合していない、CUDA 9.1は適合していない、9.0は公式サイトに登録して表を記入すればよい)、quick-guideについて一度インストールし、cuDNN 7.1,
Installing cuDNN on Windows
The following steps describe how to build a cuDNN dependent program. In the following sections:
your CUDA directory path is referred to as C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
your cuDNN directory path is referred to as 
Navigate to your  directory containing cuDNN.
Unzip the cuDNN package.
cudnn-9.0-windows7-x64-v7.zip
or
cudnn-9.0-windows10-x64-v7.zip
Copy the following files into the CUDA Toolkit directory.(       CUDA   )
Copy \cuda\bin\cudnn64_7.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin.
Copy \cuda\ include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include.
Copy \cuda\lib\x64\cudnn.lib to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64.
Set the following environment variables to point to where cuDNN is located. To access the value of the $(CUDA_PATH) environment variable, perform the following steps:
Open a command prompt from the Start menu.
Type Run and hit Enter.
Issue the control sysdm.cpl command.
Select the Advanced tab at the top of the window.
Click Environment Variables at the bottom of the window.
Ensure the following values are set:(      )
Variable Name: CUDA_PATH 
Variable Value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
Include cudnn.lib in your Visual Studio project.
Open the Visual Studio project and right-click on the project name.
Click Linker > Input > Additional Dependencies.
Add cudnn.lib and click OK.

以上の準備が完了したら、このブロガーの手順に従ってAnaconda 3+python 3をインストールします.6でいいです.1.cmdを開き、運転を入力:
conda create -n tensorflow
y

2.
activate tensorflow

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

エラーが発生する可能性があります.
TypeError: parse() got an unexpected keyword argument 'transport_encoding'  

解決する
conda install -c anaconda html5lib  

4.ipythonを開き、テスト
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

出力b「Hello,TensorFlow!」すべてのインストールに成功しました.