tensorflow 需要 GPU [英] Does tensorflow need GPU

查看:75
本文介绍了tensorflow 需要 GPU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to install TensorFlow on Linux, Ubuntu 18.10 by following these instructions: https://www.tensorflow.org/install/
I am using python 2.7

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

I first tried to install it using the pip package and after:

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

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

I got a message to say that tensorflow 1.12.0 was successfully installed, however when I did the next line:

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

我收到错误

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

The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine

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

I then tried to build from source and it failed when I tried to checkout the current branch

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

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

I skipped the GPU steps as this said optional but am wondering if it is needed?

推荐答案

不能 100% 确定你正在发生什么,但简而言之,Tensorflow 不需要 GPU,你不应该从源代码构建它,除非你只是觉得喜欢.

Not 100% certain what you have going on but in short no Tensorflow does not require a GPU and you shouldn't have to build it from source unless you just feel like it.

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

Might I suggest you try uninstalling whatever version of Tenforflow you might have, and then reinstall it.

# 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

这篇关于tensorflow 需要 GPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆