Install TensorFlow in Windows

For more installation methods, please refer to the official website of tensorflow :
https://www.tensorflow.org/versions/r0.12/get_started/os_setup

1. TensorFlow supports only 64-bit Python 3.5 on Windows. (Currently, on Windows, TensorFlow only supports 64-bit Python.)
2. TensorFlow GPU support requires having a GPU card with NVidia Compute Capability (>= 3.0). ( TensorFlow can only take advantage of it if the GPU's computing capability is >=3.0.)
3.Check NVIDIA Compute Capability of your GPU card: https://developer.nvidia.com/cuda-gpus


Install TensorFlow directly:

1. Install Anaconda
on Windows first 2. Open the command line window of Windows and enter (CPU version):

pip install tensorflow

To install the GPU version (it is recommended to install Cuda Toolkit 8.0 and cuDNN v5 first), enter:

pip install tensorflow-gpu

3. (Optional) Install keras:

pip install keras

Install TensorFlow in the Conda environment:

1. Install Anaconda
on Windows first 2. Open the command line window of Windows
3. Create a conda environment named tf and enter:

conda create -n tf python=3.5

4. Activate the environment of tf and enter:

activate tf

5. Install tensorflow (CPU version) for the tf environment:

pip install tensorflow

To install the GPU version (it is recommended to install Cuda Toolkit 8.0 and cuDNN v5 first), enter:

pip install tensorflow-gpu

6. (Optional) Install ipython for the tf environment:

conda install ipython

(Optional) Install Jupyter for the tf environment:

pip install jupyter

7. So far tensorflow has been installed, exit the tf environment and enter:

deactivate tf

Test the installed TensorFlow:

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
>>> exit()

Test TensorFlow


Note: If your Anaconda Python version is not 3.5, you can use: conda install python=3.5Switch Anaconda to Python 3.5.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325434032&siteId=291194637