Tensorflow是否需要GPU?

3
我将尝试按照以下说明在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步骤,因为它被标记为可选项,但我想知道是否需要?
2个回答

3

我不确定你的具体情况,但简单来说,Tensorflow不需要GPU支持,除非你想自己编译。建议你先卸载当前版本的Tensorflow,然后重新安装。

# 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

1

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

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

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

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接