首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Ubuntu 16.04, Python 2.7 安装 TensorFlow CPUUbuntu 16.04, Python 2.7 安装 TensorFlow CPUInstalling Tenso

Ubuntu 16.04, Python 2.7 安装 TensorFlow CPUUbuntu 16.04, Python 2.7 安装 TensorFlow CPUInstalling Tenso

作者头像
iOSDevLog
发布于 2018-05-17 02:38:18
发布于 2018-05-17 02:38:18
1.9K00
代码可运行
举报
文章被收录于专栏:iOSDevLogiOSDevLog
运行总次数:0
代码可运行

Ubuntu 16.04, Python 2.7 安装 TensorFlow CPU


  1. 安装 Virtualenv
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ sudo apt-get install python-pip python-dev python-virtualenv # for Python 2.7
  1. 创建 Virtualenv 环境
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ virtualenv --system-site-packages ~/tensorflow # for Python 2.7
  1. 激活 Virtualenv
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh

提示符改变

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ 
  1. 确保 pip ≥8.1
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ easy_install -U pip
  1. Virtualenv 环境下安装 TensorFlow
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ pip install --upgrade tensorflow      # for Python 2.7
  1. Hello World
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow) $ python hello.py 
Hello, TensorFlow!
  1. 退出 Virtualenv
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ deactivate** 

Installing TensorFlow on Ubuntu


This guide explains how to install TensorFlow on Ubuntu. Although these instructions might also work on other Linux variants, we have only tested (and we only support) these instructions on machines meeting the following requirements:

  • 64-bit desktops or laptops
  • Ubuntu 16.04 or higher

Determine which TensorFlow to install

You must choose one of the following types of TensorFlow to install:

  • TensorFlow with CPU support only. If your system does not have a NVIDIA® GPU, you must install this version. Note that this version of TensorFlow is typically much easier to install (typically, in 5 or 10 minutes), so even if you have an NVIDIA GPU, we recommend installing this version first.
  • TensorFlow with GPU support. TensorFlow programs typically run significantly faster on a GPU than on a CPU. Therefore, if your system has a NVIDIA® GPU meeting the prerequisites shown below and you need to run performance-critical applications, you should ultimately install this version.

NVIDIA requirements to run TensorFlow with GPU support

If you are installing TensorFlow with GPU support using one of the mechanisms described in this guide, then the following NVIDIA software must be installed on your system:

  • CUDA® Toolkit 9.0. For details, see NVIDIA's documentation. Ensure that you append the relevant CUDA pathnames to the LD_LIBRARY_PATH environment variable as described in the NVIDIA documentation.
  • The NVIDIA drivers associated with CUDA Toolkit 9.0.
  • cuDNN v7.0. For details, see NVIDIA's documentation. Ensure that you create the CUDA_HOME environment variable as described in the NVIDIA documentation.
  • GPU card with CUDA Compute Capability 3.0 or higher for building from source and 3.5 or higher for our binaries. See NVIDIA documentation for a list of supported GPU cards.
  • The libcupti-dev library, which is the NVIDIA CUDA Profile Tools Interface. This library provides advanced profiling support. To install this library, issue the following command for CUDA Toolkit >= 8.0:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ sudo apt-get install cuda-command-line-tools
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
and add its path to your `LD_LIBRARY_PATH` environment variable:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/usr/local/cuda/extras/CUPTI/lib64
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
For CUDA Toolkit <= 7.5 do:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ sudo apt-get install libcupti-dev
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
* **[OPTIONAL]** For optimized inferencing performance, you can also install NVIDIA TensorRT 3.0\. For details, see [NVIDIA's TensorRT documentation](http://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html#installing-tar). Only steps 1-4 in the TensorRT Tar File installation instructions are required for compatibility with TensorFlow; the Python package installation in steps 5 and 6 can be omitted. Detailed installation instructions can be found at [package documentataion](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/tensorrt#installing-tensorrt-304)

**IMPORTANT:** For compatibility with the pre-built `tensorflow-gpu` package, please use the Ubuntu **14.04** tar file package of TensorRT even when installing onto an Ubuntu 16.04 system.

If you have an earlier version of the preceding packages, please upgrade to the specified versions. If upgrading is not possible, then you may still run TensorFlow with GPU support, but only if you do the following:

  • Install TensorFlow from sources as documented in Installing TensorFlow from Sources.
  • Install or upgrade to at least the following NVIDIA versions:
    • CUDA toolkit 7.0 or greater
    • cuDNN v3 or greater
    • GPU card with CUDA Compute Capability 3.0 or higher.

Determine how to install TensorFlow

You must pick the mechanism by which you install TensorFlow. The supported choices are as follows:

We recommend the Virtualenv installation. Virtualenv is a virtual Python environment isolated from other Python development, incapable of interfering with or being affected by other Python programs on the same machine. During the Virtualenv installation process, you will install not only TensorFlow but also all the packages that TensorFlow requires. (This is actually pretty easy.) To start working with TensorFlow, you simply need to "activate" the virtual environment. All in all, Virtualenv provides a safe and reliable mechanism for installing and running TensorFlow.

Native pip installs TensorFlow directly on your system without going through any container system. We recommend the native pip install for system administrators aiming to make TensorFlow available to everyone on a multi-user system. Since a native pip installation is not walled-off in a separate container, the pip installation might interfere with other Python-based installations on your system. However, if you understand pip and your Python environment, a native pip installation often entails only a single command.

Docker completely isolates the TensorFlow installation from pre-existing packages on your machine. The Docker container contains TensorFlow and all its dependencies. Note that the Docker image can be quite large (hundreds of MBs). You might choose the Docker installation if you are incorporating TensorFlow into a larger application architecture that already uses Docker.

In Anaconda, you may use conda to create a virtual environment. However, within Anaconda, we recommend installing TensorFlow with the pip install command, not with the conda install command.

NOTE: The conda package is community supported, not officially supported. That is, the TensorFlow team neither tests nor maintains the conda package. Use that package at your own risk.

Installing with Virtualenv

Take the following steps to install TensorFlow with Virtualenv:

  1. Install pip and Virtualenv by issuing one of the following commands:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ sudo apt-get install python-pip python-dev python-virtualenv** # for Python 2.7
$ sudo apt-get install python3-pip python3-dev python-virtualenv** # for Python 3.n
  1. Create a Virtualenv environment by issuing one of the following commands:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ virtualenv --system-site-packages** *targetDirectory* # for Python 2.7
$ virtualenv --system-site-packages -p python3** *targetDirectory* # for Python 3.n
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
where `*targetDirectory*` specifies the top of the Virtualenv tree. Our instructions assume that `*targetDirectory*` is `~/tensorflow`, but you may choose any directory.
  1. Activate the Virtualenv environment by issuing one of the following commands:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ source ~/tensorflow/bin/activate** # bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh**  # csh or tcsh
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
The preceding **source** command should change your prompt to the following:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ 
  1. Ensure pip ≥8.1 is installed:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ easy_install -U pip
  1. Issue one of the following commands to install TensorFlow in the active Virtualenv environment:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ pip install --upgrade tensorflow**      # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow**     # for Python 3.n
(tensorflow)$ pip install --upgrade tensorflow-gpu**  # for Python 2.7 and GPU
(tensorflow)$ pip3 install --upgrade tensorflow-gpu** # for Python 3.n and GPU
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
If the above command succeeds, skip Step 6\. If the preceding command fails, perform Step 6.
  1. (Optional) If Step 5 failed (typically because you invoked a pip version lower than 8.1), install TensorFlow in the active Virtualenv environment by issuing a command of the following format:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ pip install --upgrade** *tfBinaryURL*   # Python 2.7
(tensorflow)$ pip3 install --upgrade** *tfBinaryURL*  # Python 3.n 
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
where `*tfBinaryURL*` identifies the URL of the TensorFlow Python package. The appropriate value of `*tfBinaryURL*`depends on the operating system, Python version, and GPU support. Find the appropriate value for `*tfBinaryURL*` for your system [here](https://tensorflow.google.cn/install/install_linux#the_url_of_the_tensorflow_python_package). For example, if you are installing TensorFlow for Linux, Python 3.4, and CPU-only support, issue the following command to install TensorFlow in the active Virtualenv environment:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ pip3 install --upgrade \
     https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.7.0-cp34-cp34m-linux_x86_64.whl

If you encounter installation problems, see Common Installation Problems.

Next Steps

After installing TensorFlow, validate the installation.

Note that you must activate the Virtualenv environment each time you use TensorFlow. If the Virtualenv environment is not currently active, invoke one of the following commands:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ source ~/tensorflow/bin/activate**      # bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh**  # csh or tcsh

When the Virtualenv environment is active, you may run TensorFlow programs from this shell. Your prompt will become the following to indicate that your tensorflow environment is active:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ 

When you are done using TensorFlow, you may deactivate the environment by invoking the deactivate function as follows:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ deactivate** 

The prompt will revert back to your default prompt (as defined by the PS1 environment variable).

Uninstalling TensorFlow

To uninstall TensorFlow, simply remove the tree you created. For example:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ rm -r** *targetDirectory* 

Installing with native pip

You may install TensorFlow through pip, choosing between a simple installation procedure or a more complex one.

Note: The REQUIRED_PACKAGES section of setup.py lists the TensorFlow packages that pip will install or upgrade.

Prerequisite: Python and Pip

Python is automatically installed on Ubuntu. Take a moment to confirm (by issuing a python -V command) that one of the following Python versions is already installed on your system:

  • Python 2.7
  • Python 3.4+

The pip or pip3 package manager is usually installed on Ubuntu. Take a moment to confirm (by issuing a pip -V or pip3 -V command) that pip or pip3 is installed. We strongly recommend version 8.1 or higher of pip or pip3. If Version 8.1 or later is not installed, issue the following command, which will either install or upgrade to the latest pip version:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ sudo apt-get install python-pip python-dev**   # for Python 2.7
$ sudo apt-get install python3-pip python3-dev** # for Python 3.n

Install TensorFlow

Assuming the prerequisite software is installed on your Linux host, take the following steps:

  1. Install TensorFlow by invoking one of the following commands:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ pip install tensorflow**      # Python 2.7; CPU support (no GPU support)
$ pip3 install tensorflow**     # Python 3.n; CPU support (no GPU support)
$ pip install tensorflow-gpu**  # Python 2.7;  GPU support
$ pip3 install tensorflow-gpu** # Python 3.n; GPU support 
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
If the preceding command runs to completion, you should now [validate your installation](https://tensorflow.google.cn/install/install_linux#ValidateYourInstallation).
  1. (Optional.) If Step 1 failed, install the latest version of TensorFlow by issuing a command of the following format:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ sudo pip  install --upgrade** *tfBinaryURL*   # Python 2.7
$ sudo pip3 install --upgrade** *tfBinaryURL*   # Python 3.n 
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
where `*tfBinaryURL*` identifies the URL of the TensorFlow Python package. The appropriate value of `*tfBinaryURL*` depends on the operating system, Python version, and GPU support. Find the appropriate value for `*tfBinaryURL*` [here](https://tensorflow.google.cn/install/install_linux#the_url_of_the_tensorflow_python_package). For example, to install TensorFlow for Linux, Python 3.4, and CPU-only support, issue the following command:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
 $ sudo pip3 install --upgrade \
     https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.7.0-cp34-cp34m-linux_x86_64.whl
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
If this step fails, see [Common Installation Problems](https://tensorflow.google.cn/install/install_linux#common_installation_problems).

Next Steps

After installing TensorFlow, validate your installation.

Uninstalling TensorFlow

To uninstall TensorFlow, issue one of following commands:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ sudo pip uninstall tensorflow**  # for Python 2.7
$ sudo pip3 uninstall tensorflow** # for Python 3.n

Installing with Docker

Take the following steps to install TensorFlow through Docker:

  1. Install Docker on your machine as described in the Docker documentation.
  2. Optionally, create a Linux group called docker to allow launching containers without sudo as described in the Docker documentation. (If you don't do this step, you'll have to use sudo each time you invoke Docker.)
  3. To install a version of TensorFlow that supports GPUs, you must first install nvidia-docker, which is stored in github.
  4. Launch a Docker container that contains one of the TensorFlow binary images.

The remainder of this section explains how to launch a Docker container.

CPU-only

To launch a Docker container with CPU-only support (that is, without GPU support), enter a command of the following format:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ docker run -it *-p hostPort:containerPort TensorFlowCPUImage*

where:

  • -p hostPort:containerPort is optional. If you plan to run TensorFlow programs from the shell, omit this option. If you plan to run TensorFlow programs as Jupyter notebooks, set both hostPort and containerPort to 8888. If you'd like to run TensorBoard inside the container, add a second -p flag, setting both hostPort and containerPort to 6006.
  • TensorFlowCPUImage is required. It identifies the Docker container. Specify one of the following values:
    • tensorflow/tensorflow, which is the TensorFlow CPU binary image.
    • tensorflow/tensorflow:latest-devel, which is the latest TensorFlow CPU Binary image plus source code.
    • tensorflow/tensorflow:version**, which is the specified version (for example, 1.1.0rc1) of TensorFlow CPU binary image.
    • tensorflow/tensorflow:version-devel**, which is the specified version (for example, 1.1.0rc1) of the TensorFlow GPU binary image plus source code.

    TensorFlow images are available at dockerhub.

For example, the following command launches the latest TensorFlow CPU binary image in a Docker container from which you can run TensorFlow programs in a shell:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ docker run -it tensorflow/tensorflow bash

The following command also launches the latest TensorFlow CPU binary image in a Docker container. However, in this Docker container, you can run TensorFlow programs in a Jupyter notebook:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ docker run -it -p 8888:8888 tensorflow/tensorflow

Docker will download the TensorFlow binary image the first time you launch it.

GPU support

Prior to installing TensorFlow with GPU support, ensure that your system meets all NVIDIA software requirements. To launch a Docker container with NVidia GPU support, enter a command of the following format:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ nvidia-docker run -it** *-p hostPort:containerPort TensorFlowGPUImage*

where:

  • -p hostPort:containerPort is optional. If you plan to run TensorFlow programs from the shell, omit this option. If you plan to run TensorFlow programs as Jupyter notebooks, set both hostPort and *containerPort* to 8888.
  • TensorFlowGPUImage specifies the Docker container. You must specify one of the following values:
    • tensorflow/tensorflow:latest-gpu, which is the latest TensorFlow GPU binary image.
    • tensorflow/tensorflow:latest-devel-gpu, which is the latest TensorFlow GPU Binary image plus source code.
    • tensorflow/tensorflow:version-gpu**, which is the specified version (for example, 0.12.1) of the TensorFlow GPU binary image.
    • tensorflow/tensorflow:version-devel-gpu**, which is the specified version (for example, 0.12.1) of the TensorFlow GPU binary image plus source code.

We recommend installing one of the latest versions. For example, the following command launches the latest TensorFlow GPU binary image in a Docker container from which you can run TensorFlow programs in a shell:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ nvidia-docker run -it tensorflow/tensorflow:latest-gpu bash

The following command also launches the latest TensorFlow GPU binary image in a Docker container. In this Docker container, you can run TensorFlow programs in a Jupyter notebook:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ nvidia-docker run -it -p 8888:8888 tensorflow/tensorflow:latest-gpu

The following command installs an older TensorFlow version (0.12.1):

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ nvidia-docker run -it -p 8888:8888 tensorflow/tensorflow:0.12.1-gpu

Docker will download the TensorFlow binary image the first time you launch it. For more details see the TensorFlow docker readme.

Next Steps

You should now validate your installation.

Installing with Anaconda

Take the following steps to install TensorFlow in an Anaconda environment:

  1. Follow the instructions on the Anaconda download site to download and install Anaconda.
  2. Create a conda environment named tensorflow to run a version of Python by invoking the following command:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ conda create -n tensorflow pip python=2.7 # or python=3.3, etc.
  1. Activate the conda environment by issuing the following command:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ source activate tensorflow
 (tensorflow)$  # Your prompt should change 
  1. Issue a command of the following format to install TensorFlow inside your conda environment:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
(tensorflow)$ pip install --ignore-installed --upgrade** *tfBinaryURL*
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
where `*tfBinaryURL*` is the [URL of the TensorFlow Python package](https://tensorflow.google.cn/install/install_linux#the_url_of_the_tensorflow_python_package). For example, the following command installs the CPU-only version of TensorFlow for Python 3.4:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
 (tensorflow)$ pip install --ignore-installed --upgrade \
     https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.7.0-cp34-cp34m-linux_x86_64.whl

Validate your installation

To validate your TensorFlow installation, do the following:

  1. Ensure that your environment is prepared to run TensorFlow programs.
  2. Run a short TensorFlow program.

Prepare your environment

If you installed on native pip, Virtualenv, or Anaconda, then do the following:

  1. Start a terminal.
  2. If you installed with Virtualenv or Anaconda, activate your container.
  3. If you installed TensorFlow source code, navigate to any directory except one containing TensorFlow source code.

If you installed through Docker, start a Docker container from which you can run bash. For example:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ docker run -it tensorflow/tensorflow bash

Run a short TensorFlow program

Invoke python from your shell as follows:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
$ python

Enter the following short program inside the python interactive shell:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
# Python  import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!') sess = tf.Session()  print(sess.run(hello))` 

If the system outputs the following, then you are ready to begin writing TensorFlow programs:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Hello, TensorFlow!

If you are new to TensorFlow, see Getting Started with TensorFlow.

If the system outputs an error message instead of a greeting, see Common installation problems.

Common installation problems

We are relying on Stack Overflow to document TensorFlow installation problems and their remedies. The following table contains links to Stack Overflow answers for some common installation problems. If you encounter an error message or other installation problem not listed in the following table, search for it on Stack Overflow. If Stack Overflow doesn't show the error message, ask a new question about it on Stack Overflow and specify the tensorflow tag.

Stack Overflow Link Error Message

36159194

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
ImportError: libcudart.so.*Version*: cannot open shared object file:
  No such file or directory

41991101

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
ImportError: libcudnn.*Version*: cannot open shared object file:
  No such file or directory

36371137 and here

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
libprotobuf ERROR google/protobuf/src/google/protobuf/io/coded_stream.cc:207] A
  protocol message was rejected because it was too big (more than 67108864 bytes).
  To increase the limit (or to disable these warnings), see
  CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.

35252888

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Error importing tensorflow. Unless you are using bazel, you should
  not try to import tensorflow from its source directory; please exit the
  tensorflow source tree, and relaunch your python interpreter from
  there.

33623453

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
IOError: [Errno 2] No such file or directory:
  '/tmp/pip-o6Tpui-build/setup.py'

42006320

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
ImportError: Traceback (most recent call last):
  File ".../tensorflow/core/framework/graph_pb2.py", line 6, in <module>
  from google.protobuf import descriptor as _descriptor
  ImportError: cannot import name 'descriptor'</module>

35190574

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
  failed

42009190

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
  Installing collected packages: setuptools, protobuf, wheel, numpy, tensorflow
  Found existing installation: setuptools 1.1.6
  Uninstalling setuptools-1.1.6:
  Exception:
  ...
  [Errno 1] Operation not permitted:
  '/tmp/pip-a1DXRT-uninstall/.../lib/python/_markerlib' 

36933958

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
  ...
  Installing collected packages: setuptools, protobuf, wheel, numpy, tensorflow
  Found existing installation: setuptools 1.1.6
  Uninstalling setuptools-1.1.6:
  Exception:
  ...
  [Errno 1] Operation not permitted:
  '/tmp/pip-a1DXRT-uninstall/System/Library/Frameworks/Python.framework/
   Versions/2.7/Extras/lib/python/_markerlib'

The URL of the TensorFlow Python package

A few installation mechanisms require the URL of the TensorFlow Python package. The value you specify depends on three factors:

  • operating system
  • Python version
  • CPU only vs. GPU support

This section documents the relevant values for Linux installations.

Python 2.7

CPU only:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.7.0-cp27-none-linux_x86_64.whl

GPU support:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.7.0-cp27-none-linux_x86_64.whl

Note that GPU support requires the NVIDIA hardware and software described in NVIDIA requirements to run TensorFlow with GPU support.

Python 3.4

CPU only:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.7.0-cp34-cp34m-linux_x86_64.whl

GPU support:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.7.0-cp34-cp34m-linux_x86_64.whl

Note that GPU support requires the NVIDIA hardware and software described in NVIDIA requirements to run TensorFlow with GPU support.

Python 3.5

CPU only:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.7.0-cp35-cp35m-linux_x86_64.whl

GPU support:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.7.0-cp35-cp35m-linux_x86_64.whl

Note that GPU support requires the NVIDIA hardware and software described in NVIDIA requirements to run TensorFlow with GPU support.

Python 3.6

CPU only:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.7.0-cp36-cp36m-linux_x86_64.whl

GPU support:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.7.0-cp36-cp36m-linux_x86_64.whl

Note that GPU support requires the NVIDIA hardware and software described in NVIDIA requirements to run TensorFlow with GPU support.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated April 9, 2018.

https://tensorflow.google.cn/install/install_linux

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018.04.14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
一文学会curl和curl详解
cURL是一个利用URL语法在命令行下工作的文件传输工具,1997年首次发行。它支持文件上传和下载,所以是综合传输工具,但按传统,习惯称cURL为下载工具。
星哥玩云
2022/05/28
5.3K0
一文学会curl和curl详解
还在用 postman?手把手教你用 curl 提高工作效率
curl 是 Linux 系统上一款网络工具,它的首字母 c 代表的是 client,表示它是客户端程序。通过 URL 方式,可以实现客户端与服务器之间传递数据。
用户3105362
2021/11/12
1.4K0
Linux - curl 命令
后面的栗子,基本都会加 -v,是为了看请求的详细过程,更容易看到对应的参数已生效,实际使用不需要每次都 -v
小菠萝测试笔记
2021/06/17
9K0
Linux - curl 命令
linux使用curl命令_如何使用curl从Linux命令行下载文件
The Linux curl command can do a whole lot more than download files. Find out what curl is capable of, and when you should use it instead of wget.
用户7886150
2020/12/30
5.3K0
Linux curl 常用示例
如果想了解curl选项的详细说明,请参考前一篇文章「Linux curl 命令详解」。
踏歌行
2020/10/15
10.1K0
Linux curl 常用示例
关于curl网站运维与开发的那些事
curl网站开发指南 常见参数: -A/--user-agent <string> 设置用户代理发送给服务器 -b/--cookie <name=string/file> cookie字符串或文件读取位置 -c/--cookie-jar <file> 操作结束后把cookie写入到这个文件中 -C/--continue-at <offset> 断点续转 -D/--dump-header <file>
学到老
2018/03/19
1.1K0
Linux系列之学会使用CURL命令进行URL测试
curl命令是一个利用URL规则在shell终端命令行下工作的文件传输工具;curl命令作为一款强力工具,curl支持包括HTTP、HTTPS、ftp等众多协议,还支持POST、cookies、认证、从指定偏移处下载部分文件、用户代理字符串、限速、文件大小、进度条等特征;做网页处理流程和数据检索自动化。
SmileNicky
2022/05/07
2.3K0
Linux系列之学会使用CURL命令进行URL测试
curl----命令行请求工具
curl是一个使用URL语法传输数据的命令行工具,支持DICT、FILE、FTP、FTPS、GOPHER、HTTP、HTTPS、IMAP、IMAPS、LDAP、LDAPS、POP3、POP3S、RTMP、RTSP、SCP、SFTP、SMTP、SMTPS、TELNET和TFTP。 curl支持SSL证书、HTTP POST、HTTP PUT、FTP上传、基于HTTP表单的上传、代理、cookie、用户+密码身份验证(Basic、Digest、NTLM、Negotiate、kerberos…)、文件传输恢复、代理隧道和其他有用技巧。
cultureSun
2023/05/18
1.1K0
Linux系列之学会使用CURL命令
curl命令是一个利用URL规则在shell终端命令行下工作的文件传输工具;curl命令作为一款强力工具,curl支持包括HTTP、HTTPS、ftp等众多协议,还支持POST、cookies、认证、从指定偏移处下载部分文件、用户代理字符串、限速、文件大小、进度条等特征;做网页处理流程和数据检索自动化。
SmileNicky
2020/07/21
1.5K0
Linux curl 命令详解
curl 是一个工具,用于传输来自服务器或者到服务器的数据。「向服务器传输数据或者获取来自服务器的数据」
踏歌行
2020/10/15
39.7K0
Linux curl 命令详解
curl 用法简介
curl 是一个命令行客户端,支持多种传输协议,最经常使用的场景就是在终端请求服务器资源。
后端码匠
2022/01/18
2K0
curl 用法简介
CURL 那些不太为人知但强大的功能
对每个人而言,真正的职责只有一个:找到自我。然后在心中坚守其一生,全心全意,永不停息。所有其它的路都是不完整的,是人的逃避方式,是对大众理想的懦弱回归,是随波逐流,是对内心的恐惧 ——赫尔曼·黑塞《德米安》
山河已无恙
2025/03/29
1210
CURL 那些不太为人知但强大的功能
Linux 下命令行CURL的15种常见示例!
在本教程中,我们将介绍Linux中的cURL命令。我们会给出一些示例来指导您了解这个强大的实用程序的功能,帮助您理解它所能实现的所有功能。
用户6543014
2019/12/17
18.4K0
Linux 下命令行CURL的15种常见示例!
curl命令
curl(CommandLine Uniform Resource Locator),是一个利用 URL 语法,在命令行终端下使用的网络请求工具,支持 HTTP、HTTPS、FTP 等协议。curl也有用于程序开发使用的版本 libcurl。
用户10638239
2024/01/16
5990
linux curl 测试域名劫持
-v 参数可以显示一次 http 通信的整个过程,包括端口连接和 http request 头信息。
葫芦
2019/05/24
10.9K0
GitHub Actions 教程:定时发送天气邮件
2019年11月,GitHub 正式开放了 GitHub Actions 这个功能,现在不用申请就能使用。
ruanyf
2020/01/22
2.1K1
curl 命令常用场景
curl 命令向 www.qq.com 发出 GET 请求,服务器返回的内容会在命令行输出。
Yorkyu
2022/03/22
6880
curl 命令常用场景
Linux - curl -w 参数详解
当 curl 没有指定 -L、--location 参数跟随重定向时,此变量将显示重定向实将跳转的实际 URL
小菠萝测试笔记
2021/06/17
5.9K0
Linux - curl -w 参数详解
linux之curl命令
原文链接:https://rumenz.com/rumenbiji/linux-curl.html
入门笔记
2021/10/20
3.2K0
curl的使用
curl是常用发起http请求工具,今天就整理下如何正确的使用curl命令,来提高工作效率。
付威
2020/01/21
1.7K0
相关推荐
一文学会curl和curl详解
更多 >
LV.0
腾讯前端开发工程师
目录
  • Ubuntu 16.04, Python 2.7 安装 TensorFlow CPU
  • Installing TensorFlow on Ubuntu
    • Determine which TensorFlow to install
      • NVIDIA requirements to run TensorFlow with GPU support
    • Determine how to install TensorFlow
    • Installing with Virtualenv
      • Next Steps
      • Uninstalling TensorFlow
    • Installing with native pip
      • Prerequisite: Python and Pip
      • Install TensorFlow
      • Next Steps
      • Uninstalling TensorFlow
    • Installing with Docker
      • CPU-only
      • GPU support
      • Next Steps
    • Installing with Anaconda
    • Validate your installation
      • Prepare your environment
      • Run a short TensorFlow program
    • Common installation problems
    • The URL of the TensorFlow Python package
      • Python 2.7
      • Python 3.4
      • Python 3.5
      • Python 3.6
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档