tensorflow detailed process installation Win10

First statement points:

Tensorflow installation is based on Python and Anaconda need to download from the warehouse.

So our steps are: first download Anaconda, install a Python in Anaconda, the (Your computer may already installed a Python environment, but Anaconda in Python is to be re-installed), and then download and install tensorflow.

Because the anaconda python version support with TensorFlow supported python version inconsistencies may cause installation errors, so download time must not download the latest version of the anaconda, first inquiry under tensorflow support python which version and then the next.

tensorflow currently supports Python 2.7 and 3.5 versions.

Anaconda corresponding python version:

 So I installed: Anaconda3-4.0.0-Windows-x86_64.exe and Python3.5.

This part can be used as a reference, as seen on some of the blog says, because some versions do not match the installation fails, at least I both versions are installed successfully.

First, install Anaconda

Downloaded from the official website: https://www.anaconda.com/download/

Download the official website is slow, the domestic Tsinghua mirror site: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

The default installation. Note here:

Enter the windows in command mode, run cmd:

 Input: Conda --version   detect whether the installation was successful anaconda environment

Second, the installation Tensorflow

Installation Tensorflow, enter the Anaconda Prompt: Conda  Create - n-tensorflow Python = 3.5 of

Under normal circumstances will be very slow to download large probability will fail, because the general default link is mirrored address abroad, must be very slow to download.

The change of address link mirror: Open installed in Anaconda Anaconda Prompt,

Then enter:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/     

conda config --set show_channel_urls yes

Connector into two lines of code for the Tsinghua mirror.

Open C: \ Users \ Administrator \ .condarc file:

Delete two lines of code:

ssl_verify: true
- defaults

Then enter the Anaconda Prompt: Conda  Create - n-tensorflow Python = 3.5 of

 

 

If there are multiple installations unsuccessful cases, the successful installation of that time will prompt:
Just follow the prompts instructions, you can clean up the buffer.

Input activate tensorflow, switched, on behalf of the installation was successful.

We want to install a CPU version, then immediately enter the command:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

 

If this step appears:

 Because pip version needs to be upgraded, the installation can be prompted to enter commands.

Regardless of the installation steps, then: 
when installing the CPU version, bloggers reference of the blog using the following command: 
PIP install -i HTTPS: // pypi.tuna.tsinghua.edu.cn/simple/ HTTPS: // Mirrors. tuna.tsinghua.edu.cn/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl 
will find that after being given the run: 
by You give the MUST AT Least One Requirement to install (See " PIP Help install " )
There is no reason behind the install parameters, that is to say no to the package you want to install 
may be because of the wrong website link back, or relocation of a resource site. To check on the resource site, modified to correct resource address. 
Here of course, because the relocation site address, use 
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow 
it.

Third, the test

In Anaconda Prompt window, type: python

After entering python in turn enter:

import tensorflow as tf

sess = tf.Session()

= tf.constant(10)

b= tf.constant(12)

sess.run(a+b)

The results of 22 runs, it means you have a fully installed Tensorflow.

If the test phase the following problems:

The reason is because the numpy version does not correspond.

But in the CMD interface version is can not be replaced. Requires Python editor, I was in PyCharm in.

But it has no installation and Tensorflow relationship.

In PyCharm, the need to use our anaconda in Python, you can not use the computer installed inside the Python environment.

Then input command: PIP the install numpy == 1.16 .0 to.

Without the module when the test code, you can download the module.

 

 

 

Guess you like

Origin www.cnblogs.com/ming-4/p/11516728.html