8

我对 theano 比较陌生,我想在我的 GPU 上运行 mnist 示例,但我得到以下输出:

Using gpu device 0: GeForce GTX 970M (CNMeM is disabled)
Loading data...
Building model and compiling functions...
WARNING (theano.gof.compilelock):
    Overriding existing lock by dead process '9700' (I am process '10632')

DEBUG: nvcc STDOUT mod.cu
Creating library 
  C:/Users/user/AppData/Local/Theano
    /compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_71_Stepping_1_GenuineIntel-3.4.3-64
    /tmp55nlvvvo/m25b839e7715203be227800f03e7c8fe8.lib 
and object 
  C:/Users/user/AppData/Local/Theano
    /compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_71_Stepping_1_GenuineIntel-3.4.3-64
    /tmp55nlvvvo/m25b839e7715203be227800f03e7c8fe8.exp

它一直输出 DEBUG 消息,没有任何 mnist 输出。我有一个工作版本的 nvcc:

C:\Users\user>nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2015 NVIDIA Corporation
Built on Tue_Aug_11_14:49:10_CDT_2015
Cuda compilation tools, release 7.5, V7.5.17

还有我的.theanorc文件:

[global]
floatX = float32
device = gpu0

[nvcc]
fastmath = True

我该如何解决这个问题?

4

1 回答 1

1

我有一个类似的问题。搜索谷歌并获取代码。https://github.com/Theano/Theano/blob/master/theano/sandbox/cuda/nvcc_compiler.py

        p = subprocess.Popen(
                cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        nvcc_stdout_raw, nvcc_stderr_raw = p.communicate()[:2]
        console_encoding = getpreferredencoding()
        nvcc_stdout = decode_with(nvcc_stdout_raw, console_encoding)
        nvcc_stderr = decode_with(nvcc_stderr_raw, console_encoding)

    if nvcc_stdout:
        # this doesn't happen to my knowledge
        print("DEBUG: nvcc STDOUT", nvcc_stdout, file=sys.stderr)

似乎 nvcc 有错误输出。

但在我的场合,它的输出看起来像

调试:nvcc STDOUT mod.cu

调试:nvcc STDOUT mod.cu

有时程序在此之后工作正常,有时不起作用。这很奇怪。对不起,我不能发表评论,所以我只是发布答案。

于 2016-04-10T07:30:16.570 回答