• 首先要安装virtualenv
$ sudo apt-get install python-pip python-dev python-virtualenv 
  • 创建虚拟环境(如果使用默认的python版本则无需-p命令,如果要用指定的python版本,则使用-p命令来指定;我们假定创建的虚拟环境为tensorflow,即targetDirectory为tensorflow)
$ virtualenv -p /usr/bin/期望使用的python版本 targetDirectory 
  • 激活虚拟环境
$ source ~/tensorflow/bin/activate
  • 激活之后的虚拟环境变为
(tensorflow)$
  • 在激活的虚拟环境中安装TensorFlow
 (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
  • 如果上面的命令执行之后安装失败,则说明pip版本太低,无法通过https来下载,可以升级pip版本
 (tensorflow)$ pip install --upgrade TF_PYTHON_URL   # Python 2.7
 (tensorflow)$ pip3 install --upgrade TF_PYTHON_URL  # Python 3.N 
  • 如果升级失败,依然无法安装TF的话,则直接执行下面的命令,通常都可以安装成功

    • Python2.7(CPU/GPU)

      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp27-none-linux_x86_64.whl 
      
      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl
    • Python3.4(CPU/GPU)

      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp34-cp34m-linux_x86_64.whl
      
      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp34-cp34m-linux_x86_64.whl
    • Python3.5(CPU/GPU)

      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp35-cp35m-linux_x86_64.whl
      
      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp35-cp35m-linux_x86_64.whl
    • Python3.6(CPU/GPU)

      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp36-cp36m-linux_x86_64.whl
      
      (tensorflow)$ pip install --ignore-installed --upgrade \
      https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp36-cp36m-linux_x86_64.whl
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐