在Ubuntu 14.04,TitanX pascal,Cuda8.0上安装支持GPU的theano 0.9

时间:2017-05-31 17:27:04

标签: theano theano-cuda

这让我发疯了。我在this guide之后安装了所需的libgpuarray。但我一直在犯错误。

在本指南中:

cd <dir>
rm -rf build Build
mkdir Build
cd Build
cmake .. -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_BUILD_TYPE=Release
make
make install
DEVICE="<test device>" make test

cd ..

# Run the following export and add them in your ~/.bashrc file
export CPATH=$CPATH:~/.local/include
export LIBRARY_PATH=$LIBRARY_PATH:~/.local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.local/lib

python setup.py build
python setup.py install --user
cd
DEVICE="<test device>" python -c "import pygpu;pygpu.test()"

我应该在DEVICE="<test device>"中引用我的gpu。但是我在这里尝试了一切:gpu,gpu0等 但它仍然找不到任何GPU ...

我收到以下错误:

$python setup.py build
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    raise Exception('cython is too old or not installed '
Exception: cython is too old or not installed (at least 0.25 required)

我忽略了,因为我的pip无法安装比全局安装版本低的版本,尽管我使用的是virtualenv。最后我收到了这个错误:

$DEVICE="gpu0" python -c "import pygpu;pygpu.test()"
ERROR: Failure: ValueError (Unknown device format:gpu)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/test_tools.py", line 5, in <module>
    from .support import (guard_devsup, rand, check_flags, check_meta, check_all,
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/support.py", line 32, in <module>
    context = gpuarray.init(get_env_dev())
  File "pygpu/gpuarray.pyx", line 634, in pygpu.gpuarray.init (pygpu/gpuarray.c:9407)
  File "pygpu/gpuarray.pyx", line 583, in pygpu.gpuarray.pygpu_init (pygpu/gpuarray.c:9073)
ValueError: Unknown device format:gpu

----------------------------------------------------------------------
Ran 7 tests in 0.002s

FAILED (errors=7)

编辑:
好的,所以现在使用&#34; cuda0&#34;

DEVICE="cuda0" python -c "import pygpu;pygpu.test()"

但计算似乎仍然失败:

======================================================================
FAIL: pygpu.tests.test_blas.test_rgemmBatch_3d(16, 16, 9, 16, 'float32', ('f', 'f', 'c'), (False, False), False, 1, True, True, 0.6, 0.6)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/support.py", line 39, in f
    func(*args, **kwargs)
  File "/home/myUser/.local/lib/python2.7/site-packages/pygpu-0.6.5-py2.7-linux-x86_64.egg/pygpu/tests/test_blas.py", line 225, in rgemmBatch_3d
    numpy.testing.assert_allclose(cr, numpy.asarray(gr), rtol=1e-5)
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 1392, in assert_allclose
    verbose=verbose, header=header)
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 739, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=1e-05, atol=0

(mismatch 99.9565972222%)
 x: array([[[ 364.203369,  258.57843 ,  282.774231, ...,  322.785706,
          185.089233,  300.292389],
        [ 203.502457,  226.207962,  202.701843, ...,  213.377808,...
 y: array([[[ 239.617569,  217.584824,  167.131165, ...,  211.116486,
          313.409271,  244.467926],
        [ 248.086868,  237.813416,  164.860977, ...,  216.871902,...

----------------------------------------------------------------------
Ran 7292 tests in 177.637s

FAILED (failures=137)

0 个答案:

没有答案