Install Tensorflow Python 3.7 Windows

Posted on by admin

Download and install the Microsoft Visual C Redistributable for Visual Studio 2015, 2017 and 2019 for your platform. Make sure long paths are enabled on Windows. Install the 64-bit Python 3 release for Windows (select pip as an optional feature). Curl https:// bootstrap. Py - o get - pip. Environment Windows 10 64 bit Visaul Studio 2019 Anaconda 1.9.7 Python 3.7 CUDA Toolkit 10.1.120 CUDNN 7.6.1.34 TensorFlow-GPU 1.14.0 1. Install visual studio 2019 vs is known as the strongest ide in the universe. It has never been disappointing since contact. It can be downloaded directly on the official website. Since visual studio 2017,. Jan 20, 2019 Fourthly, you should use 'pip install -ignore-installed -upgrade tensorflow1.14.0' to install TensorFlow 1.14 on Conda Finally, you can use TensorFlow that is version 1.14 on python 3.7 Have a Great Time. Ubuntu/Mac (Python without Anaconda) $ source tf2/bin/activate. Conda on Ubuntu/Mac (Python from Anaconda) $ conda activate tf2. After the activation, the terminal will change to this (tf2) $. Install TensorFlow 2.0. The following instructions are the same for the both Python options. Steps to Install TensorFlow. The installation part will consist of two parts: – Installing Anaconda; Setting up TensorFlow using Anaconda Prompt. Part 1: Install Anaconda on Windows. Anaconda is a bundle of some popular python packages and has a package manager called conda (similar to pip).

environment

Windows 10 64 bit

Visaul Studio2019

Anaconda 1.9.7

Python 3.7

CUDA Toolkit 10.1.120

CUDNN 7.6.1.34

TensorFlow-GPU 1.14.0

1. Install visual studio 2019

vs is known as the strongest ide in the universe. It has never been disappointing since contact. It can be downloaded directly on the official website. Since visual studio 2017, python module has been integrated to support machine learning, and its installation method has also added online installation. During installation, you can select the required components for installation, but it takes a little longer. The installation interface is as follows:

You can choose to install Python version 3.7 in a single component, but Anaconda needs to be installed later. In order to facilitate unified package management and environment construction, you can skip here.

Note: when selecting the installation location, remember the location of shared components, tools and SDK, which will be used when installing Anaconda later.

2. Install CUDA

(1) CUDA ™ It is a general parallel computing architecture launched by NVIDIA, which enables GPU to solve complex computing problems. First, check the CUDA version supported by your computer’s n card, and open NVIDIA control panel – help – system information – component:

the blogger’s nvcuda version is 10.1.120, so download CUDA version 10.1.

Installation types include online installation and local installation. Online installation can be selected if the network speed allows.

(2) Before installation, close the security software first, otherwise it is likely to prompt that the component installation fails. The installation space is about more than one g. if Disk C has enough space, it is best to choose the default installation location to avoid unnecessary environment configuration problems. The default installation location is C: program files NVIDIA GPU computing toolkit CUDA v10.1.

(3) Next, you need to add a wave of environment variables

Then add four pieces of information in the path of the system variable – new

(4) After configuration, use CUDA’s built-in tools to verify whether the configuration is successful. Start CMD with Win + R and CD to the installation directory C: program files NVIDIA GPU computing toolkit CUDA v10.1 extras demo_ Under suite, execute devicequery.exe and bandwidthtest.exe respectively. The output information is as follows:

If result = pass is returned above, CUDA configuration is successful.

3. Install cudnn

(1) Select the cudnn version that you want to match with the CUDA version. You need to register on the official website before downloading.

(2) Unzip the downloaded files, and then copy the files in the bin, include and lib folders to the bin, include and lib folders of the CUDA installation directory.

4. Install anaconda

(1) Anaconda provides more than 180 science packages including Python and their dependencies. You can choose to download the latest version directly on Anaconda’s official website.

(2) To avoid configuring Anaconda in the visual studio 2019 IDE, install it directly under the shared path of vs. The vs installation directory of the blogger is D: Microsoft Visual Studio, and the shared path is D: program files (x86) Microsoft Visual Studio shared.

(3) Open visual studio 2019, create a new Python project, view – Other windows – Python environments, and Anaconda’s installation environment will be displayed.

At this time, the default environment name is Anaconda 2019.03. OCD patients are very upset and can change the display name in the registry.

1) Open registry: Win + R — regedit

2) Navigate to HKEY_ LOCAL_ Machine software python (32-bit interpreter)

Or HKEY_ LOCAL_ Machine software wow6432node python (64 bit interpreter)

3) Expand the node matching the distribution. Anaconda is continuum analytics

4) Modify the numerical data corresponding to displayName, such as anaconda37. The name of the python environment in vs will be changed accordingly.

5. Install tensorflow GPU

(1) If you directly download and install online in the form of command line, the downloaded version may be incompatible with CUDA version. Tensorflow can also be installed in Anaconda navigator, but its version is 1.9.0. This blog post installs the latest version [as of the blog update date, the latest versions are tensorflow 1.14.0 stable and tensorflow 2.0 beta]. Therefore, this article downloads the WHL file of GitHub God. Save it in any local location (the blogger’s address is D: apppackages tensorflow).

(2) In vs Python environments, click open in PowerShell

(3) Enter the installation instructions on the command line:pip install D:AppPackagesTensorFlowtensorflow_gpu-1.14.0-cp37-cp37m-win_amd64.whl

6. Verification test

Enter the code in the project. Py file:

If console outputGPU related informationAnd the output information of the codeb'Hello Google Tensorflow!', the environment is built successfully!

Note: tensorflow_ Gpu-1.14.0 discards some code interfaces and uses new interfaces. For example, TF. Session() is changed to TF. Compat. V1. Session(), TF. Placeholder is changed to TF. Compat. V1. Placeholder.

This is the end of this article about configuring CUDA 10.1 + tensorflow GPU 1.14.0 under Visual Studio 2019. For more information about configuring CUDA tensorflow GPU in Visual Studio 2019, please search previous articles of developeppaer or continue to browse the relevant articles below. I hope you will support developeppaer in the future!

This tutorial will show you how to install TensorFlow on Windows. You do need need any special hardware. Although, you should be running Windows 10 on a 64-bit processor.

TensorFlow maintains a number of Docker images that are worth trying if you do not want to fight with version numbers. Read about how to use the TensorFlow Docker images here.

Prerequisites

We need to pay attention to version numbers, as TensorFlow works with only certain versions of Python. Head to this page to look at the available versions of TensorFlow.

At the time of writing, the most recent version of TensorFlow available is 2.2.0. By looking at the table, we can see that it requires Python version 3.5-3.8.

VersionPython versionCompilerBuild tools
tensorflow-2.2.03.5-3.8MSVC 2019Bazel 2.0.0

Install Anaconda

While you could install TensorFlow directly on your system next to whatever Python version you wish, I recommend doing everything through Anaconda.

Anaconda provides a terminal prompt and can easily help you switch between Python environments. This proves to be extremely helpful when you want to run multiple versions of Python and TensorFlow side by side.

Tensorflow

Head to anaconda.com and download the Individual Edition for your operating system (Windows x64). Run the Anaconda installer and accept all the default settings.

When that is complete, run the Anaconda Prompt (anaconda3).

How to download tensorflow

Install TensorFlow

In the terminal, we want to create a new Python environment. This helps us keep various versions of Python and TensorFlow separate from each other (such as separate CPU and GPU versions). Enter the following commands:

Check the version of Python that came with Anaconda using the following command:

If you want to use different version of Python, you can enter the following command (x.x is the version of Python). For example, I will install 3.7, as that falls in the acceptable version range for TensorFlow 2.2.0, which requires Python 3.5-3.8:

If you wish to also install Jupyter Notebook, you can do so with the following:

Note that if you switch environments in Anaconda (e.g. to tensorflow-gpu), you will need to reinstall packages, as the each environment keeps everything separate.

If we run pip on its own to install TensorFlow, it will likely try to pull an outdated version. Since we want the newest release, we’ll have to tell pip where to download a specific wheel file (.whl).

Navigate to the TensorFlow Pip Install page and look at the Package Location list.

Go to the Windows section and find the CPU-only version that supports your version of Python. For me, this will be the .whl file listed with Python 3.7 CPU-only. Note that the required versions are listed in the filename: CPU-only (_cpu), TensorFlow version (-2.2.0), and supported Python version (-cp37). Highlight and copy the .whl file URL.

In Anaconda, enter the following command and replace <wheel_url> with the URL that you just copied:

Press ‘enter’ and wait a few minutes while TensorFlow installs.

When it’s done, go into the Python command line interface:

Check if TensorFlow is installed by entering the following commands:

Tensorflow

You should see the version of TensorFlow printed out (e.g. “2.2.0”).

Close the Anaconda prompt.

Running TensorFlow

Install

When you’re ready to work with TensorFlow, open the Anaconda Prompt and enter the following:

How To Download Tensorflow

Now, you can use TensorFlow from within the Anaconda Prompt or start a Jupyter Notebook session.

This article gives a good introduction to using Jupyter Notebook.

If you want to install a Python package, you can do so inside of the Anaconda Prompt. Make sure that you are in the desired environment (e.g. tensorflow-cpu) first and that Jupyter Notebook is not running (quit Jupyter Notebook by pressing ctrl+c inside the Anaconda Prompt). From there, install a package with:

You can also install a package from inside Jupyter Notebook by running the following command in a cell:

For example, I installed matplotlib here:

Going Further

If you have an NVIDIA graphics card capable of running CUDA, you might be able to speed up some of your TensorFlow applications by enabling GPU support. You will need to install several drivers, and I recommend installing tensorflow-gpu in a separate Anaconda environment. See this guide on installing TensorFlow with GPU support on Windows.

Install Tensor Flow Python

See the following videos if you are looking for an introduction on TensorFlow and TensorFlow Lite: