【问题标题】:Does tensorflow need GPU张量流需要GPU吗
【发布时间】:2018-11-29 13:08:57
【问题描述】:

我正在尝试按照以下说明在 Linux、Ubuntu 18.10 上安装 TensorFlow:https://www.tensorflow.org/install/
我正在使用 python 2.7

我首先尝试使用 pip 包安装它,然后:

pip install --user --upgrade tensorflow  # install in $HOME

我收到一条消息说 tensorflow 1.12.0 已成功安装,但是当我执行下一行时:

python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

我收到了错误

TensorFlow 库未编译为使用 SSE4.1 指令,但这些指令可在您的计算机上使用

然后我尝试从源代码构建,但当我尝试签出当前分支时失败了

bazel test -c opt -- //tensorflow/... -//tensorflow/compiler/... -//tensorflow/lite/...

我跳过了 GPU 步骤,因为这是可选的,但我想知道是否需要它?

【问题讨论】:

    标签: python-2.7 tensorflow


    【解决方案1】:

    不是 100% 确定你在做什么,但简而言之,Tensorflow 不需要 GPU,除非你喜欢它,否则你不应该从源代码构建它。

    我是否建议您尝试卸载您可能拥有的任何版本的 Tenforflow,然后重新安装。

    # Try both of these just to be safe
    pip uninstall tensorflow
    pip uninstall tensorflow-gpu 
    
    # I recommend using conda when possible 
    conda install tensorflow
    
    # but if you don't have conda then pip will work just fine
    pip install tensorflow
    

    【讨论】:

      【解决方案2】:

      TensorFlow 库未编译为使用 SSE4.1 指令,但这些指令可在您的计算机上使用

      请注意,这只是一个警告,不会阻止 TF 正常运行。

      您可以从 PIP 安装的 TF 版本被编译为可在广泛的系统上使用,但 TF 可以通过源代码中的系统特定优化进行编译。此警告旨在提醒您。

      另见https://github.com/tensorflow/tensorflow/issues/7778

      【讨论】:

        猜你喜欢
        • 2020-10-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多