Ado*_*orn 6 python dll installation pdb theano
我想在Windwos 8上安装Theano
遵循了这些步骤.
我尝试使用测试:
import numpy as np
import time
import theano
print('blas.ldflags=', theano.config.blas.ldflags)
A = np.random.rand(1000, 10000).astype(theano.config.floatX)
B = np.random.rand(10000, 1000).astype(theano.config.floatX)
np_start = time.time()
AB = A.dot(B)
np_end = time.time()
X, Y = theano.tensor.matrices('XY')
mf = theano.function([X, Y], X.dot(Y))
t_start = time.time()
tAB = mf(A, B)
t_end = time.time()
print("NP time: %f[s], theano time: %f[s] (times should be close when run on CPU!)" % (
np_end - np_start, t_end - t_start))
print("Result difference: %f" % (np.abs(AB - tAB).max(), ))
Run Code Online (Sandbox Code Playgroud)
我知道该脚本是numpy和theano计算时间之间的比较.
但不知何故,找不到一些dll.Pl找到以下日志:
[Py341] C:\>python ML\Deep\TheanoSetupTesting.py
blas.ldflags= -LE:\Things_Installed_Here\Theano\openblas -lopenblas
Traceback (most recent call last):
File "ML\Deep\TheanoSetupTesting.py", line 12, in <module>
mf = theano.function([X, Y], X.dot(Y))
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\function.py", line 317, in function
output_keys=output_keys)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\pfunc.py", line 526, in pfunc
output_keys=output_keys)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\function_module.py", line 1778, in orig_function
defaults)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\compile\function_module.py", line 1642, in create input_storage=input_storage_lists, storage_map=storage_map)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\link.py", line 690, in make_thunk
storage_map=storage_map)[:3]
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\vm.py", line 1037, in make_all
no_recycling))
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\op.py", line 932, in make_thunk
no_recycling)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\op.py", line 850, in make_c_thunk
output_storage=node_output_storage)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1207, in make_thunk
keep_lock=keep_lock)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1152, in __compile__
keep_lock=keep_lock)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1602, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cmodule.py", line 1174, in module_from_key module = lnk.compile_cmodule(location)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cc.py", line 1513, in compile_cmodule
preargs=preargs)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cmodule.py", line 2196, in compile_str
return dlimport(lib_filename)
File "E:\Things_Installed_Here\Anaconda_Py\envs\Py341\lib\site-packages\theano-0.7.0-py3.4.egg\theano\gof\cmodule.py", line 331, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed: The specified module could not be found.
Run Code Online (Sandbox Code Playgroud)
作为python世界的新手,我无法找到未找到的Dll.如果丢失我会安装它,并将添加系统路径变量的路径.但是我怎么知道它是哪个dll.我尝试在各个位置使用pdb并设置断点cmodule.py,但没有一个被击中.
theano.我发现了一些帖子,建议微软编译器工作得很好.但是我已经连续14个小时以来一直在讨论一个问题,并且想要一种有效的方法.最终我想要theano我的系统.顺便说一句,没有CUDA.我只在尝试CPU.
这可能有点晚了.我按照与你完全相同的指南,遇到了同样的错误.
原来可以通过将openblas目录添加到系统路径来修复它.在您的示例中,将"E:\ Things_Installed_Here\Theano\openblas"添加到系统路径变量.
请注意,根据放置DLL文件的位置,您需要添加"E:\ Things_Installed_Here\Theano\openblas"或"E:\ Things_Installed_Here\Theano\openblas\bin".
Windows 10 64位,Python 3.5.1(Anaconda 2.5),Theano 0.8.2.
对于那些需要它的人,我可以在Windows 10中安装Theano,这要归功于这三个指南guide1,guide2和OP附带的指南.
好吧,我终于找到了至少我使用 WinPython、python3.5.1.1、Win 7 64bit 和 mingw64 安装的原因:
在 .theanorc[.txt] 文件中,安装 blas 后,我有一个 [blas] 部分,其中一行包含 openblas 包含路径。我删除了该行并将下面的区域留为空白。重新启动 WinPython/Spider,打开一个新控制台,它就可以工作了。
随后使用 Theano 从 Lasagne 运行 mnist.py 进行测试。