Install TensorFlow on WIN10 (Official document translation)

Source: Internet
Author: User
Tags virtual environment cuda toolkit

I. Recommended TWO websites

    • TensorFlow Official Document: Https://www.tensorflow.org/install/install_windows
    • TensorFlow Chinese Community: http://www.tensorfly.cn/tfdoc/get_started/os_setup.html

Two. install TensorFlow on Windows

Directory:

    1. Determine the TensorFlow to install
    2. Requirements for using GPU-supported TensorFlow
    3. Determine how to install TensorFlow
    4. Using a native PIP installation
    5. Installing with Anaconda
    6. Verify that your installation
    7. Common installation Issues
This guide explains how to install TensorFlow on Windows1. determine the TensorFlow to be installed to install the following types of TensorFlow, you must select one of these:
    • Use only CPU-supported TensorFlow. What if your system does not have NVIDIA? GPU, you must install this version. Please note that this version of TensorFlow is usually easier to install (usually in 5 or 10 minutes), so even if you have NVIDIA? GPU, we recommend that you install this version first.
    • GPU-supported TensorFlow. The TensorFlow program runs on the GPU usually much faster than on the CPU. So, what if your system has an NVIDIA? The GPU meets the prerequisites shown below, and you need to run the application efficiently, you should eventually install this version.

2. requirements for using GPU-supported TensorFlow

If you use one of the mechanisms described in this guide to install GPU-supported TensorFlow, you must install the following NVIDIA software on your system:
    • CUDA? Toolkit8.0. For more information, see the NVIDIA documentation to make sure that you append the associated Cuda pathname to the%path% environment variable, as described in the Nvidia documentation.
    • The NVIDIA driver associated with CUDA Toolkit 8.0.
    • CuDNN v6.0. For more information, see the documentation for NVIDIA. Note that CuDNN is usually installed in a different location than other CUDA DLLs. Make sure that the directory where the CuDNN DLL is installed is added to the%path% environment variable.
    • A GPU card with CUDA computing power of 3.0 or higher. For a list of supported GPU cards, see the NVIDIA documentation.
If you have a different version of the previous package, change to the specified version. In particular, the CuDNN version must match exactly: if Cudnn64_6. dll is not found, TensorFlow will not load. To use different versions of CuDNN, you must generate from source code. 3.determine how to install TensorFlowYou must choose a mechanism for installing tensorflow. The supported options are as follows:
    • Using PIP
    • Anaconda
local PIP installs the TensorFlow directly on your system without having to go through a virtual environment. Since PIP installation is not isolated in a separate container, PIP installation may interfere with the installation of other python-based on the system. However, if you understand Pip and your Python environment, the PIP installation usually requires only one command! In addition, if you install using PIP, the user can run the TensorFlow program from any directory on the system. in Anaconda, you can use Conda to create a virtual environment. However, in Anaconda, we recommend installing TensorFlow with the pip install command instead of conda the install command. Note: The Conda package is supported by the community and is not supported by the official. That is, the TensorFlow team neither tests nor maintains the Conda package. Use Conda to contain certain risks. 4. Install with this PIPIf you do not have one of the following versions of Python installed on your computer, install it now:
    • Python 3.5.x 64-bit from python.org
    • Python 3.6.x 64-bit from python.org
-tensorflow supports Python 3.5.x and 3.6.x on Windows. Please note that Python 3 comes with the PIP3 Package Manager, which is the program you use to install TensorFlow. to install TensorFlow, start the terminal. Then issue the appropriate PIP3 installation command in the terminal. To install only the CPU version of TensorFlow, enter the following command:
c:\> PIP3 Install--upgrade TensorFlow
to install the GPU version of TensorFlow, enter the following command:
c:\> PIP3 Install--upgrade Tensorflow-gpu

  

5. install with Anaconda Anacondathe installation was supported by the community and was not officially supported. take the following steps to install TensorFlow in the Anaconda Environment:

1). Follow the instructions on the Anaconda download website to download and install the Python

2). Create a Conda environment named TensorFlow by calling the following command:

3). Activate the Conda environment by issuing the following command:
C:> activate TensorFlow (tensorflow) c:>  

4). issue the appropriate command to install TensorFlow in your Conda environment. To install only the CPU version of TensorFlow, enter the following command:

5). to install the GPU version of TensorFlow, enter the following command (on one line):

6. Verify your installation

start the terminal. If you install through Anaconda, activate your anaconda environment. call Python from the shell as follows:
$ python
Enter the following short programs in the shell of the Python interaction:
>>> import TensorFlow as tf>>> hello = tf.constant (' Hello, tensorflow! ') >>> sess = tf. Session () >>> print (Sess.run (hello))

 

if the system outputs the following, you are ready to start writing the TensorFlow program:
Hello, tensorflow!.

  

If you are a new tensorflow beginner, see Getting Started with TensorFlow (https://www.tensorflow.org/get_started/get_started). if the system is outputting an error message instead of a greeting, see Common installation Issues (Https://www.tensorflow.org/install/install_windows#common_installation_problems). There is also a useful script (https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c) for Windows TensorFlow installation issues. 7.Common Installation Issueswe rely on the stack overflow to record TensorFlow installation problems and how to remedy them. The following table contains links to stack overflow answers to some common installation issues. If you encounter an error message or other installation issue that is not listed in the following table, search for it when the stack overflows. If the stack overflow does not display an error message, ask a new question about it in the stack overflow and specify the TensorFlow tag.
Stack Overflow Link Error Message
41007279
[... \stream_executor\dso_loader.cc] Couldn ' t open CUDA library Nvcuda.dll
41007279
[... \stream_executor\cuda\cuda_dnn.cc] Unable to load CuDNN DSO
42006320
Importerror:traceback (most recent): File "... \tensorflow\core\framework\graph_pb2.py", line 6, in from Google. PROTOBUF Import Descriptor as _descriptorimporterror:cannot import name ' descriptor '
42011070
No module named "Pywrap_tensorflow"
42217532
Opkernel (' op: ' bestsplits ' device_type: ' CPU ') for unknown op:bestsplits
43134753
The TensorFlow library wasn ' t compiled to use SSE instructions
translated from: Https://www.tensorflow.org/install/install_windows

Install TensorFlow on WIN10 (Official document translation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.