native Windows installation TensorFlow 0.12 methodTags: tensorflowwindows2016-12-04 11:23 37737 people read reviews Collection report Classification:TensorFlow
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
November 29, 2016, TF official announced that version 0.12 tensorflow support native Windows operating system, do not need to install through Docker. As a TF beginner, it is also heavily dependent on the users of windows, through the walls of various searches, and finally found a feasible installation method. is summarized, for peer reference.
Bo Master machine configuration:
[HTML]View PlainCopy
- Os:window 7 64bit
- Cpu:intel i7-2600k
- Memory: 8G
- Graphics: Nvidia GeForce GTX 560
(It is recommended to use Windows PowerShell instead of CMD, so the following one or two, three or four steps are performed under Power shell, "Start", "Accessories", "Windows Power Shell", "windows Power Shell ")
First, install Python
1. Install Python on Windows via pip
TensorFlow only supports 64-bit Python3.5 on Windows, and can be 3.5 from python.org or Python 3.5 from Anaconda via Python Download and install Python3.5.2 (note Selecting the correct operating system).
2. Setting Environment variables
After the previous step was installed, entering PIP in PowerShell was not found for the command, so add the "% installation path%\scripts" Under the Python installation path to path, and then enter PIP in PowerShell to see several command prompts, Python installation is successful (Python installation package comes with PIP). Start, all programs, or you can find the Python terminal.
Two, install Cuda and CUDNN(CPU version TensorFlow Please ignore this step)
TensorFlow is divided into CPU version and GPU version, if you plan to install GPU version, please install the following two drivers first:
1. Cuda Installation: Https://developer.nvidia.com/cuda-downloads
2, CUDNN Installation: HTTPS://DEVELOPER.NVIDIA.COM/CUDNN (to register Nvidia users, and join the CUDNN Development Group, fill out a number of questionnaires can be downloaded) Select Download version should pay attention to and Cuda version matching. After decompression, cover to Cuda's installation directory
Example: C:\Program files\nvidia GPU Computing toolkit\cuda\v8.0\
Third, revise the PIP domestic source
In order to accelerate PIP installation using a domestic image, the following modifications are required:
WIndows 7 under the C:\Users\ User name \appdata\local\pip folder, create a new text file and add content:
[HTML]View PlainCopy
- [Global]
- Index-url = http://mirrors.aliyun.com/pypi/simple/
- [Install]
- trusted-host=mirrors.aliyun.com
About modifying PIP domestic source can refer here
Iv. installation of TensorFlow
Install CPU version TensorFlow 0.12,power shell under input:
[HTML]View PlainCopy
- Pip Install--upgrade HTTPS://STORAGE.GOOGLEAPIS.COM/TENSORFLOW/WINDOWS/CPU/TENSORFLOW-0.12.0RC0-CP35-CP35M-WIN_AMD64.WHL
Install GPU version TensorFlow 0.12,power shell under input:
[HTML]View PlainCopy
- Pip Install--upgrade Https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_ Gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
View the latest version of the download method
Installation via PIP will prompt for error "Http error 404". It is estimated that the network can not be caused by the installation of the TF command HTTPS and the following address copy, and paste into the browser address bar to manually download the file.
Then enter the following command in the power Shell to implement the local installation:
[HTML]View PlainCopy
- Pip Install F:\DEVRESOURCES\TENSORFLOW_GPU-0.12.0RC0-CP35-CP35M-WIN_AMD64.WHL
Error occurred:
For some reason, NumPy 1.11.0 cannot be downloaded properly. To do so, manually download NumPy (119MB) and install it. Numpy
I choose to download: NUMPY?1.11.2+MKL?CP35?CP35M?WIN_AMD64.WHL. Where 1.11.2 is the nympy version, Cp35 says support for PYTHON3.5,WIN_AMD64 is support for WINDOWS64-bit operating systems.
After downloading, install NumPy first:
[HTML]View PlainCopy
- Pip Install F:\DEVRESOURCES\NUMPY-1.11.2+MKL-CP35-CP35M-WIN_AMD64.WHL
Install TensorFlow again (repeat the steps above to install TensorFlow), and the installation is successful.
Five, Test TensorFlow
Under "All Programs" find "Python 3.5 64bit", a command window appears, enter the test code:
[HTML]View PlainCopy
- >>>import tensorflow as TF
- >>>sess = TF. Session ()
- >>>a = tf.constant (Ten)
- >>>b = tf.constant ($)
- >>>print (Sess.run (A + b))
- 32
Correct output 32, installation completed.
The above methods refer to a lot of network information, but also have their own attempts, if there is a wrong place also ask everyone to criticize correct!
-
Top
-
8
-
Step
Windows installation TensorFlow