Home>Article>Backend Development> Which version of python is better for tensorflow?

Which version of python is better for tensorflow?

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼 Original
2019-06-15 11:04:58 16673browse

Which python version does tensorflow use?

Related recommendations: "python video"

Which version of python is better for tensorflow?

1. Install anaconda

tensorflow is based on the python scripting language , so you need to install python, and of course you also need to install dozens of extension packages such as numpy, scipy, six, matplotlib, etc. If you install them one by one, when will they be installed? (I once spent a day just installing scipy...)

But now with the integrated environment anaconda, the installation is convenient. Most of the extension packages of python are integrated in anaconda, so you only need to install this one thing.

First go to https://www.continuum.io/downloads to download anaconda. The current versions include python2.7 version and python3.5 version. Download the corresponding version and the corresponding system anaconda. It is actually An sh script file is about 300M-400M. It is recommended to use the Linux version of python 2.7, because some things in tensorflow do not support python3.5 (such as cPickle).

Which version of python is better for tensorflow?

After downloading successfully, execute in the terminal (version 2.7):

# bash Anaconda2-4.1.1-Linux-x86_64.sh

Or version 3.5:

# bash Anaconda3-4.1.1-Linux-x86_64.sh

During the installation process, you will be asked for the installation path, directly Just press Enter and the default will be fine. There is a place that asks you whether to add the anaconda installation path to the environment variable (.bashrc). You must enter yes

After successful installation, an anaconda2 folder will be generated in the current user root directory. Just the installed content. In the terminal, you can enter

conda info to query the installation information.

Enter conda list to query which libraries you have installed. Commonly used python, numpy, and scipy are among them. If you have any packages that have not been installed, you can run

conda install *** to install them (*** represents the package name). If a package version is not the latest, run conda update *** That's it.

2. Install tensorflow

First execute in the terminal:

Which version of python is better for tensorflow?

anaconda search -t conda tensorflow

Search for tensorflow installation packages, check the version, and select The highest version installed. For example, I see that version 0.10.0rc0 is the highest, as shown below:

Therefore, execute the following code to view detailed information:

anaconda show jjhelmus/tensorflow

It will tell you how to install this package , execute in the terminal:

conda install --channel https://conda.anaconda.org/jjhelmus tensorflow

and then enter "y" to install.

3. Debugging

We can test whether the installation is successful or not.

Enter python in the terminal, enter the python compilation environment, and then enter:

import tensorflow as tf

Introduce the tensorflow package. If no error is reported, the installation is successful, otherwise there will be a problem.

Then you can enter

tf.__version__tf.__path__

to view the installation version and installation path of tensorflow (two underscores on the left and right).

The above is the detailed content of Which version of python is better for tensorflow?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn