tensorflow 安装 - tensorflow - PyPI

tensorflow 安装 - tensorflow cpu - gpu - PyPI

https://pypi.org/project/tensorflow/
https://pypi.org/project/tensorflow-gpu/

TensorFlow is an open source machine learning framework for everyone.

1. Project description

TensorFlow is an open source software library for high performance numerical computation. Its flexible architecture allows easy deployment of computation across a variety of platforms (CPUs, GPUs, TPUs), and from desktops to clusters of servers to mobile and edge devices.
TensorFlow 是一个用于高性能数值计算的开源软件库。其灵活的架构允许在各种平台 (CPU,GPU,TPU)、桌面、服务器集群、移动和边缘设备上轻松部署计算。

Originally developed by researchers and engineers from the Google Brain team within Google’s AI organization, it comes with strong support for machine learning and deep learning and the flexible numerical computation core is used across many other scientific domains.
最初由谷歌人工智能组织内谷歌大脑团队的研究人员和工程师开发,它为机器学习和深度学习提供了强有力的支持,灵活的数值计算核心被用于许多其他科学领域。

2. 使用 Python 的 pip 软件包管理器安装 TensorFlow

# Latest version CPU
sudo pip install tensorflow

sudo pip install tensorflow==1.11.0
sudo pip install tensorflow==1.4.0
sudo pip install tensorflow==1.3.0
# Latest version GPU
sudo pip install tensorflow-gpu

sudo pip install tensorflow-gpu==1.11.0
sudo pip install tensorflow-gpu==1.4.0
sudo pip install tensorflow-gpu==1.3.0

3. 使用 Python3 的 pip3 软件包管理器安装 TensorFlow

# Latest version CPU
sudo pip3 install tensorflow 

sudo pip3 install tensorflow==1.11.0
sudo pip3 install tensorflow==1.4.0
sudo pip3 install tensorflow==1.3.0
# Latest version GPU
sudo pip3 install tensorflow-gpu

sudo pip3 install tensorflow-gpu==1.11.0
sudo pip3 install tensorflow-gpu==1.4.0
sudo pip3 install tensorflow-gpu==1.3.0

4. Sample

sudo pip install tensorflow==1.4.0

strong@foreverstrong:~$ sudo pip install tensorflow==1.4.0
[sudo] password for strong: 
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/strong/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow==1.4.0
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/99/72/a420e22dc93416d30981e87a2318823ec09a9b18631369df0e7d9d164073/tensorflow-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/99/72/a420e22dc93416d30981e87a2318823ec09a9b18631369df0e7d9d164073/tensorflow-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /packages/99/72/a420e22dc93416d30981e87a2318823ec09a9b18631369df0e7d9d164073/tensorflow-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl
  Downloading https://files.pythonhosted.org/packages/99/72/a420e22dc93416d30981e87a2318823ec09a9b18631369df0e7d9d164073/tensorflow-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl (40.7MB)
    100% |████████████████████████████████| 40.8MB 327kB/s 
Requirement already satisfied: enum34>=1.1.6 in /usr/local/lib/python2.7/dist-packages (from tensorflow==1.4.0) (1.1.6)
Requirement already satisfied: protobuf>=3.3.0 in /usr/local/lib/python2.7/dist-packages (from tensorflow==1.4.0) (3.4.0)
Requirement already satisfied: six>=1.10.0 in ./.local/lib/python2.7/site-packages (from tensorflow==1.4.0) (1.11.0)
Requirement already satisfied: wheel in ./.local/lib/python2.7/site-packages (from tensorflow==1.4.0) (0.30.0)
Requirement already satisfied: backports.weakref>=1.0rc1 in /usr/local/lib/python2.7/dist-packages (from tensorflow==1.4.0) (1.0rc1)
Collecting numpy>=1.12.1 (from tensorflow==1.4.0)
  Downloading https://files.pythonhosted.org/packages/1f/c7/198496417c9c2f6226616cff7dedf2115a4f4d0276613bab842ec8ac1e23/numpy-1.16.4-cp27-cp27mu-manylinux1_x86_64.whl (17.0MB)
    100% |████████████████████████████████| 17.0MB 1.3MB/s 
Collecting tensorflow-tensorboard<0.5.0,>=0.4.0rc1 (from tensorflow==1.4.0)
  Downloading https://files.pythonhosted.org/packages/64/cd/f3d14d441eb1c5228aaf7e12e8e94895ae73e9af50383e481610b34357bd/tensorflow_tensorboard-0.4.0-py2-none-any.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 874kB/s 
Requirement already satisfied: mock>=2.0.0 in ./.local/lib/python2.7/site-packages (from tensorflow==1.4.0) (2.0.0)
Requirement already satisfied: setuptools in ./.local/lib/python2.7/site-packages (from protobuf>=3.3.0->tensorflow==1.4.0) (36.6.0)
Requirement already satisfied: werkzeug>=0.11.10 in ./.local/lib/python2.7/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.0) (0.12.2)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python2.7/dist-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.0) (2.6.9)
Collecting futures>=3.1.1; python_version < "3.2" (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.0)
  Downloading https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
Requirement already satisfied: html5lib==0.9999999 in ./.local/lib/python2.7/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.0) (0.9999999)
Requirement already satisfied: bleach==1.5.0 in ./.local/lib/python2.7/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.0) (1.5.0)
Requirement already satisfied: pbr>=0.11 in ./.local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow==1.4.0) (3.1.1)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in ./.local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow==1.4.0) (1.0.2)
Installing collected packages: numpy, futures, tensorflow-tensorboard, tensorflow
  Found existing installation: numpy 1.11.0
    Uninstalling numpy-1.11.0:
      Successfully uninstalled numpy-1.11.0
  Found existing installation: futures 3.0.5
    Uninstalling futures-3.0.5:
      Successfully uninstalled futures-3.0.5
  Found existing installation: tensorflow-tensorboard 0.1.8
    Uninstalling tensorflow-tensorboard-0.1.8:
      Successfully uninstalled tensorflow-tensorboard-0.1.8
Successfully installed futures-3.2.0 numpy-1.16.4 tensorflow-1.4.0 tensorflow-tensorboard-0.4.0
strong@foreverstrong:~$ 
strong@foreverstrong:~$ 
strong@foreverstrong:~$ python
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.4.0'
>>> 
>>> tf.__path__
['/usr/local/lib/python2.7/dist-packages/tensorflow']
>>> 
>>> exit()
strong@foreverstrong:~$

5. Sample

sudo pip install tensorflow-gpu==1.4.0

strong@foreverstrong:~$ sudo pip install tensorflow-gpu==1.4.0
[sudo] password for strong: 
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/strong/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow-gpu==1.4.0
  Downloading https://files.pythonhosted.org/packages/91/b5/5219622fa7c17197eb1611eaa045270737e1a57eb854ef5359aac7d79cd7/tensorflow_gpu-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl (170.1MB)
    100% |████████████████████████████████| 170.1MB 35kB/s 
Requirement already satisfied: enum34>=1.1.6 in /usr/local/lib/python2.7/dist-packages (from tensorflow-gpu==1.4.0) (1.1.6)
Requirement already satisfied: protobuf>=3.3.0 in /usr/local/lib/python2.7/dist-packages (from tensorflow-gpu==1.4.0) (3.4.0)
Requirement already satisfied: six>=1.10.0 in ./.local/lib/python2.7/site-packages (from tensorflow-gpu==1.4.0) (1.11.0)
Requirement already satisfied: wheel in ./.local/lib/python2.7/site-packages (from tensorflow-gpu==1.4.0) (0.30.0)
Requirement already satisfied: backports.weakref>=1.0rc1 in /usr/local/lib/python2.7/dist-packages (from tensorflow-gpu==1.4.0) (1.0rc1)
Requirement already satisfied: numpy>=1.12.1 in /usr/local/lib/python2.7/dist-packages (from tensorflow-gpu==1.4.0) (1.16.3)
Requirement already satisfied: tensorflow-tensorboard<0.5.0,>=0.4.0rc1 in /usr/local/lib/python2.7/dist-packages (from tensorflow-gpu==1.4.0) (0.4.0)
Requirement already satisfied: mock>=2.0.0 in ./.local/lib/python2.7/site-packages (from tensorflow-gpu==1.4.0) (2.0.0)
Requirement already satisfied: setuptools in ./.local/lib/python2.7/site-packages (from protobuf>=3.3.0->tensorflow-gpu==1.4.0) (36.6.0)
Requirement already satisfied: werkzeug>=0.11.10 in ./.local/lib/python2.7/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu==1.4.0) (0.12.2)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python2.7/dist-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu==1.4.0) (2.6.9)
Requirement already satisfied: futures>=3.1.1; python_version < "3.2" in /usr/local/lib/python2.7/dist-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu==1.4.0) (3.2.0)
Requirement already satisfied: html5lib==0.9999999 in ./.local/lib/python2.7/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu==1.4.0) (0.9999999)
Requirement already satisfied: bleach==1.5.0 in ./.local/lib/python2.7/site-packages (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow-gpu==1.4.0) (1.5.0)
Requirement already satisfied: pbr>=0.11 in ./.local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow-gpu==1.4.0) (3.1.1)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in ./.local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow-gpu==1.4.0) (1.0.2)
Installing collected packages: tensorflow-gpu
Successfully installed tensorflow-gpu-1.4.0
strong@foreverstrong:~$

你可能感兴趣的:(TensorFlow)