Tensorflow可以与Theano一起安装吗? [英] Can Tensorflow be installed alongside Theano?

查看:215
本文介绍了Tensorflow可以与Theano一起安装吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Nvidia Tesla K80上与Theano一起安装tensorflow。我正在使用Cuda 7.5,并按照此处给出的说明进行操作
Theano本身可以很好地工作,但是一旦按照说明从源代码安装tensorflow或使用pip install,nvidia-smi和Theano就会停止工作。

I'm trying to install tensorflow alongside Theano on a Nvidia Tesla K80. I'm working with Cuda 7.5 and following the instructions given here Theano by itself works well, but as soon as I install tensorflow from source code following the instructions OR using pip install, nvidia-smi as well as Theano stops working.

更具体地说,nvidia-smi无限期挂起,而Theano只是拒绝在GPU模式下运行。

More specifically, nvidia-smi hangs indefinitely whereas Theano just refuses to run in GPU mode.

我也在使用最新版本的cudnn v4。
Tensorflow是否存在导致nvidia-smi挂起并且与Theano不兼容的已知问题?

I'm also using the latest version of cudnn v4. Does Tensorflow have known issues with respect to causing nvidia-smi to hang and being non-compatible with Theano?

推荐答案

TensorFlow选择所有可用的GPU。因此,如果您在Theano之前启动它,则Theano默认情况下将不提供任何GPU。如果首先启动Theano,TensorFlow将在无法使用GPU Theano的情况下发生段错误。

TensorFlow pick all the avaible GPU. So if you start it before Theano, Theano won't have any GPUs available by default. If you start Theano first, TensorFlow will segfault when it can't get the GPU Theano use.

要解决此问题,请使NVIDIA驱动程序仅向TensorFlow显示设备您希望他使用此环境变量看到的内容:

To work around that, make the NVIDIA driver only show to TensorFlow the device that you want him to see with this environment variable:

CUDA_VISIBLE_DEVICES=0 python ...

这篇关于Tensorflow可以与Theano一起安装吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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