2
我建了一个Python包使用GPU,这样我可以做相对进口,如:Theano无法运行时的Python作为模块(蟒蛇-m)
from ..utils import gen_utils
从
package_name/gpu_code/script_using_theano.py
,如果我的文件结构是这样的:
package_name/
--utils/
----gen_utils.py
--gpu_code/
----script_using_theano.py
然而,当我运行python -m package_name.gpu_code.script_using_theano
我得到以下错误:
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: libcublas.so.7.5: cannot open shared object file: No such file or directory
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: cuda unavilable)
的时候我就跑
python package_name/gpu_code/script_using_theano.py
,我能够使用GPU只是在这种情况下,罚款此错误不会出现。我想知道是否有一些Theano配置设置开始通过将python作为模块来改变?
一切都比较导入?我不确定你是什么意思。无论如何,问题不在于能够导入任何东西,只是Python在作为模块运行时访问GPU。 – bschreck
好吧,我明白你的意思了。 Theano需要导入一个相对于我的主目录的路径才能看到它的配置文件。由于我作为模块运行,主目录不再处于Python的路径中,所以我需要明确地添加它。这工作 – bschreck