不多说,直接上干货!
前言
建议参照最新的tensorflow安装步骤(Linux,官方网站经常访问不是很稳定,所以给了一个github的地址): https://github.com/tensorflow/tensorflow/blob/master/tensorflow/docs_src/install/install_linux.md
最近,tensorflow网站上给出了新的使用Anaconda配置和安装Tensorflow的步骤,经过测试,在国内可以无障碍的访问。Anaconda 是一个基于python的科学计算包集合,目前支持Python 2.7,3.4,3.5,3.6。
注意:在安装过程中如果出现很长的报错,观察错误信息的末尾,如果是网络链接相关,就重新运行一遍语句即可(如出现进度条不动的情况,也可重新运行语句),Anaconda自身约500M,tensorflow所需软件包约几十M。
操作系统: Ubuntu 14.04 或 Ubuntu16.04
这是Github官网给出的安装步骤
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/docs_src/install/install_linux.md
第一步、 安装Anaconda
从anaconda官网(https://www.continuum.io/downloads)上下载linux版本的安装文件,运行完成安装。
我这里是以Anaconda2-5.0.1-Linux-x86_64.sh为例,Anaconda3一样啦。这个很简单。
deeplearning@deeplearningsinglenode:~/SoftWare$ pwd/home/deeplearning/SoftWare
deeplearning@deeplearningsinglenode:~/SoftWare$ ll
total519916drwxrwxr-x 4 deeplearning deeplearning 4096 12月 4 09:42 ./drwxr-xr-x 17 deeplearning deeplearning 4096 12月 3 20:46 ../
-rwxrw-r-- 1 deeplearning deeplearning 532375438 12月 4 09:42 Anaconda2-5.0.1-Linux-x86_64.sh*drwxr-xr-x 8 deeplearning deeplearning 4096 8月 5 2015 jdk1.8.0_60/drwxrwxr-x 11 deeplearning deeplearning 4096 12月 3 20:07 pycharm-2017.3/deeplearning@deeplearningsinglenode:~/SoftWare$ bash ./Anaconda2-5.0.1-Linux-x86_64.sh
Welcome to Anaconda25.0.1In order tocontinuethe installation process, please review the license
agreement.
Please, press ENTER tocontinue
>>>
===================================Anaconda End User License Agreement===================================Copyright2015, Anaconda, Inc.
All rights reserved under the3-clause BSD License:
Redistribution and useinsource and binary forms, with or without modification, are permitted provided that the following conditio
ns are met:* Redistributions of source code must retain the above copyright notice, thislist of conditions and the following disclaimer.* Redistributions in binary form must reproduce the above copyright notice, thislist of conditions and the following disclaimerin the documentation and/or other materials provided with the distribution.* Neither the name of Continuum Analytics, Inc. (dba Anaconda, Inc.) ("Continuum") nor the names of its contributors may be used
to endorse or promote products derivedfrom thissoftware without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT N
OT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CON
TINUUM BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY TH
EORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Notice of Third Party Software Licenses=======================================Anaconda contains open source software packagesfrom third parties. These are available on an "as is" basis and subject to their individual license agreements. These licenses are availablein Anaconda or at https://docs.anaconda.com/anaconda/packages/pkg-docs .
Any binary packages of these third party tools you obtain via Anaconda are subject to their individual licenses as well asthe Anac
onda license. Continuum reserves the right to change which third party tools are providedinAnaconda.
In particular, Anaconda contains re-distributable, run-time, shared-library files from the Intel(TM) Math Kernel Library ("MKL bina
ries"). You are specifically authorized to use the MKL binaries with your installation of Anaconda. You are also authorized to redi
stribute the MKL binaries with Anaconda or inthe conda package that contains them. Use and redistribution of the MKL binaries are
subject to the licensing terms located at https://software.intel.com/en-us/license/intel-simplified-software-license. If needed, in
structions for removing the MKL binaries after installation of Anaconda are available at http://www.anaconda.com.
Anaconda also contains cuDNN software binariesfrom NVIDIA Corporation ("cuDNN binaries"). You are specifically authorized to use t
he cuDNN binaries with your installation of Anaconda. You are also authorized to redistribute the cuDNN binaries with an Anaconda p
ackage that contains them. If needed, instructionsforremoving the cuDNN binaries after installation of Anaconda are available at
http://www.anaconda.com.
Cryptography Notice===================This distribution includes cryptographic software. The countryinwhich you currently reside may have restrictions on the import, p
ossession, use, and/or re-export to another country, of encryption software. BEFORE usingany encryption software, please check you
r country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see
if this is permitted. See the Wassenaar Arrangement for more information.
Continuum has self-classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information securit
y softwareusing or performing cryptographic functions with asymmetric algorithms. The form and manner of thisdistribution makes i
t eligibleforexport under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administ
ration Regulations, Section740.13) for both objectcode and source code. In addition, the Intel(TM) Math Kernel Library containedin Continuum's software is classified by Intel(TM) as ECCN 5D992b with no license required for export to non-embargoed countries.
The following packages are includedin thisdistribution that relate to cryptography:
openssl
The OpenSSL Projectis a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit imp
lementing the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocolsas well as a full-strength general purpose cr
yptography library.
pycrypto
A collection of both secure hash functions (suchasSHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, El
Gamal, etc.).
pyop