TensorFlow installation-windows

Source: Internet
Author: User
Tags cuda toolkit

Ref: 77836459

First, installation environment

The TensorFlow can support the CPU, or it can support CPU+GPU. The former has a simple environmental requirement and the latter requires additional support. TensorFlow is developed based on vc++2015, so you need to download the installation visualc++ redistributable for Visual Studio 2015来 get MSVCP140.DLL support. If you are installing a GPU version (with n cards, or nvidia graphics cards), the following additional environments are required:

0) There are NVIDIAGPU cards that support Cuda computing capacity 3.0 or later.

1) Download and install Cuda Toolkit 8.0 and make sure its path is added to the PATH environment variable;

2) Download and install CUDNN V6 or v6.1 and make sure its path is added to the PATH environment variable;

3) CUDA8.0 related nvidia driver.

Second, the installation process

With the above installation conditions (CPU or GPU), TensorFlow can be installed in two ways. One is "native" Pip, two is anaconda. Recommend the former, relatively simple.

A) using "native" Pip installation

1) Download and install Python 3.5.x 64-bit, pay attention to version 3.5.x.

2) Open the Windows command-line window and install the CPU version input

PIP3 Install--upgrade TensorFlow

(Error during installation: Connecttimeouterror. Solution: Pip install virtualenv-i https://pypi.douban.com/simple)

Installing GPU Version input

PIP3 Install--upgrade Tensorflow-gpu

II) installation with Anaconda

1) Download and install anaconda;

2) Open a command-line window to create a Conda environment

Conda create-n TensorFlow python=3.5

3) activating the Conda environment

Activate TensorFlow

4) Install CPU version input

Pip Install--ignore-installed--upgrade tensorflow

Installing GPU Version input

Pip Install--ignore-installed--upgrade TENSORFLOW-GPU

Third, verify the installation

To verify that the TensorFlow installation was successful, either enter Python into the Python environment in the Command Line window, or run the python3.5 command line and enter the following code:

>>>import TensorFlow as TF
>>> Hello = tf.constant (' Hello, tensorflow! ')
>>> sess = tf. Session ()
>>> Print (Sess.run (hello))

If the hello string can be output normally, the installation succeeds.

Hello, tensorflow!.

Four, installation errors

Common installation Error Reference links, one of the frequently encountered errors is no module named "Pywrap_tensorflow" or "Failed toload the native TensorFlow runtime", The main reason is that the installation environment does not meet the requirements, refer to the following link to answer:

Https://stackoverflow.com/questions/43942185/failed-to-load-the-native-tensorflow-runtime-python-3-5-2

Https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso

TensorFlow Install-windows

Related Article

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.