【问题标题】:Error when importing theano using GPU使用 GPU 导入 theano 时出错
【发布时间】:2015-10-25 06:19:03
【问题描述】:

我正在尝试将 theano 用于通过 anaconda 在 CentOS 5.6 上安装的 python 2.7。如果只使用 cpu,我可以导入 theano,但是当我尝试使用 gpu 运行它时,我得到 hte 错误:

>>> import theano
Using gpu device 0: Tesla K20m
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/ASR1/yunwang/software/anaconda/lib/python2.7/site-packages/theano/__init__.py", line 98, in <module>
    theano.sandbox.cuda.tests.test_driver.test_nvidia_driver1()
  File "/data/ASR1/yunwang/software/anaconda/lib/python2.7/site-packages/theano/sandbox/cuda/tests/test_driver.py", line 39, in test_nvidia_driver1
    if not numpy.allclose(f(), a.sum()):
  File "/data/ASR1/yunwang/software/anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 606, in __call__
    storage_map=self.fn.storage_map)
  File "/data/ASR1/yunwang/software/anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 595, in __call__
outputs = self.fn()
TypeError: Argument not a CudaNdarray
Apply node that caused the error: GpuCAReduce{add}{1}(<CudaNdarrayType(float32, vector)>)
Inputs types: [CudaNdarrayType(float32, vector)]
Inputs shapes: [(10000,)]
Inputs strides: [(1,)]
Inputs values: ['not shown']

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag 'optimizer=fast_compile'. If that does not work, Theano optimizations can be disabled with 'optimizer=None'.
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.

关于如何解决这个问题的任何想法?我一直在尝试一切,从重新安装 cuda、anaconda、python...

【问题讨论】:

  • 我使用的是 CentOS 5.6。
  • 我在 Ubuntu 14.04 上配置了 Theano/CUDA/python,所以我不知道这是否重要,但安装说明 here 适用于 CentOS 6。也许升级会有所帮助。

标签: python anaconda theano


【解决方案1】:

我在阅读此link 后发现了问题。显然,theano 创建了一个导致问题的缓存文件夹 .theano。删除此文件夹后已修复。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-20
    • 1970-01-01
    • 1970-01-01
    • 2017-05-13
    • 1970-01-01
    • 2015-10-05
    • 2018-04-14
    相关资源
    最近更新 更多