Theano从0.7升级到最前沿后的错误

时间:2016-02-26 09:05:57

标签: theano cudnn

我安装并使用了Theano 0.7,一切都运行良好。但是现在为了我未来的工作目的,我需要最新版本,并且安装顺利。

但是,当我运行此little test(在Theano文档中找到)时,会产生许多错误(see here for the full list)。

  • 我们可以观察到GPU被检测到并被使用,但是找不到cuDNN:

Using gpu device 0: GeForce GT 650M (CNMeM is enabled with initial size: 65.0% of memory, CuDNN not available)

  • 然后我有一个导入错误,我认为它也是关于cuDNN:

ImportError: ('The following error happened while compiling the node', <theano.sandbox.cuda.DnnVersion object at 0x114d32710>(), '\n', 'dlopen(/Users/FiReTiTi/.theano/compiledir_Darwin-13.4.0-x86_64-i386-64bit-i386-2.7.11-64/tmpwmA_hw/265abc51f7c376c224983485238ff1a5.so, 2): Library not loaded: @rpath/libcudnn.4.dylib\n Referenced from: /Users/FiReTiTi/.theano/compiledir_Darwin-13.4.0-x86_64-i386-64bit-i386-2.7.11-64/tmpwmA_hw/265abc51f7c376c224983485238ff1a5.so\n Reason: image not found', '[<theano.sandbox.cuda.DnnVersion object at 0x114d32710>()]')

我已经检查过了,cudnn.h仍然在/Developer/NVIDIA/CUDA-7.5/include/,在/Developer/NVIDIA/CUDA-7.5/lib/我们仍然找到了libcudnn.dylib,这是libcudnn.4.dylib的符号链接,{{1 }指向/usr/local/cuda

有什么想法吗?

[编辑]在我的.profile中,我们发现:

/Developer/NVIDIA/CUDA-7.5/

export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-7.5/lib:$DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:$DYLD_LIBRARY_PATH 中,有一个指向实际位于/usr/local/cuda/lib的cudnn库的符号链接。

以下是命令/Developer/NVIDIA/CUDA-7.5/lib的结果:

tool -L libcudnn.4.dylib

以下是:libcudnn.4.dylib: @rpath/libcudnn.4.dylib (compatibility version 0.0.0, current version 4.0.7) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.14.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1) /usr/local/cuda/lib/libcudnn.dylib -> /Developer/NVIDIA/CUDA-7.5/lib/libcudnn.dylib之间的关联/Developer/NVIDIA/CUDA-7.5/lib

[编辑2]

libcudnn.dylib -> libcudnn.4.dylib

[编辑3] Here is the last error显示。至少有一部分,因为这个错误出现在每个时代。

使用$ echo $DYLD_LIBRARY_PATH /usr/local/xuggler/lib:/usr/local/cuda/lib:/Applications/IMOD/lib: $ echo $LD_LIBRARY_PATH /usr/local/cuda/lib:

ls -la /usr/local/cuda/lib

1 个答案:

答案 0 :(得分:1)

这看起来像Theano中的一个错误。如果他们将["-Wl,-rpath,%s" % l for l in c_lib_dirs()]添加到compile args中,它可能会有效。您应该报告上游here

如果您将libcudnn.4.dylib的路径添加到LD_LIBRARY_PATH(或可能DYLD_LIBRARY_PATH)环境变量中,它可能会作为一种解决方法,因为@rpath也是@rpath/libcudnn.4.dylib看看,以便可以解决路径Runnable