【问题标题】:Pip only install cpu tensorflow of tensorflow 0.11pip 只安装 tensorflow 0.11 的 cpu tensorflow
【发布时间】:2017-01-13 03:13:27
【问题描述】:

我之前安装了tensorflow-gpu v 0.12,它运行良好,但我需要v0.11 同事的代码。所以我卸载了 tensorflow 和 tensorflow-gpu 0.12 并尝试安装 v 0.11:

pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl

它成功安装了 tensorflow,但不是 gpu 版本,即使在上面的链接中我使用的是 gpu 而不是 cpu 版本。显然,我选择cpu还是gpu都没有关系,它总是只安装cpu版本。

知道如何解决这个问题吗?

【问题讨论】:

    标签: tensorflow pip


    【解决方案1】:

    对于 tensorflow 版本 0.11.x 及以下版本,pip 中没有任何 tensorflow-gpu 包。 https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl 对应的轮子是支持gpu 的正确轮子。如果你通过 pip 安装这个轮子,它会说 Installed tensorflow==0.11.0 但支持 CUDA-8。通过下载各个轮子,cpugpu 文件夹具有不同的 md5 签名,因此它们是不同的。

    here

    【讨论】:

      【解决方案2】:

      运行中

      pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
      

      我可以成功安装tensorflow v 0.11

      【讨论】:

      • 我可以用这个答案安装 tensorflow v 0.11
      • 运行这个命令真的会安装 tensorflow 0.11 吗?我尝试执行命令,但运行“import tensorflow as tf”时显示错误? ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory
      【解决方案3】:

      @user8289596 回答以下命令对我的情况很有用,我已经成功安装了 tensorflow 0.11

      pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl

      注意:我在 python 2.7 和 linux 中使用 anaconda

      【讨论】:

        【解决方案4】:

        对于 MacOS、Python 3,这对我有用:

        export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py3-none-any.whl
        

        然后安装:

        sudo pip3 install --upgrade $TF_BINARY_URL
        

        Source 还提供 Python 2 和 3 在各种 Ubuntu/Linux 和 MacOS 配置上的说明。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2020-07-26
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多