我正在尝试在Windwos 8上安装Theano
已遵循these步骤。
我试着用以下方法测试:
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(), ))
字符串
我知道脚本是numpy和theano计算时间的比较。
但不知何故,一些dll没有找到。请找到以下日志:
[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.
型
作为python世界的新手,我无法找到哪个Dll没有找到。如果缺少,我会安装它,并将路径添加到系统路径变量。但我如何知道它是哪个dll。我尝试使用pdb
并在cmodule.py
的各个位置设置断点,但没有命中。
1.你熟悉这种错误及其解决方法吗?
1.否则,请帮助我找到丢失的dll名称,其余的由我来完成。
1.我不介意在安装theano
时走一条完全不同的道路。我遇到了一些建议微软编译器工作正常的帖子。但我已经坐在一个问题上,因为过去14个小时连续,并希望有一个工作的方法。最终我希望在我的系统上theano
。
顺便说一句,没有CUDA
。我只在CPU上试。
6条答案
按热度按时间uubf1zoe1#
这可能有点晚了。我遵循了和你完全一样的指南,也遇到了同样的错误。
原来它可以通过将openbox目录添加到系统路径来修复。在您的示例中,将“E:\Things_Installed_Here\Theano\openbox”添加到系统路径变量。
请注意,根据您放置DLL文件的位置,您需要添加“E:\Things_Installed_Here\Theano\openbox”或“E:\Things_Installed_Here\Theano\openbox\bin”。
Windows 10 64位,Python 3.5.1(Anaconda 2.5),Theano 0.8.2。
对于那些需要它的人,我能够在Windows 10中安装Theano,这要归功于这三个指南guide1,guide2和OP所附的指南。
b91juud32#
好了,我终于找到了原因,至少我使用WinPython,python3.5.1.1,Win 7 64位和mingw 64安装:
在.theanorc[.txt]文件中,我在安装了Python之后,有一个部分[Python],其中有一行包含了OpenPython的包含路径。我删除了那一行,并将[Python]下面的区域留空。重新启动WinPython/Spider,打开一个新的控制台,它工作了。
之后使用Theano从Lasagne运行 mnist.py进行测试。
yqyhoc1h3#
我也在努力让theano在Windows 10 x64上工作,在阅读了几个帮助指南之后,最终对我起作用的是以下内容:
1.安装Intel Distribution for Python(确保c:\intelpython27\和c:\intelpython27\scripts位于PATH中)
1.打开一个命令行并执行:
conda install mingw libpython
1.然后执行:
pip install theano
1.从http://sourceforge.net/projects/openblas/files/v0.2.14/下载预编译的libopenblas.dll(我得到了OpenBLAS-v0.2.14-Win64-int32.zip)
1.也可以从http://sourceforge.net/projects/openblas/files/v0.2.14/mingw64_dll.zip/download下载mingw64_dll.zip
1.例如,将OpenBLAS-v0.2.14-Win64-int32.zip解压缩到c:\openbox
1.将mingw64_dll.zip解压缩到c:\openbox\bin
1.将c:\openbox\lib和c:\openbox\bin添加到PATH
1.在c:\Users{username}中创建. theanorc.txt
1.在.theanorc.txt中输入以下内容:
字符串
希望这对某人有帮助。
ecr0jaav4#
只是为了增加我的经验与Win10 64位和theano(和keras).我得到了DLL加载失败错误以及.尝试了所有的东西,我已经发现在theano win安装网页和在不同的论坛和博客文章(在这里提到Uradium的帖子).
它对我不起作用,但以下是有效的:
1.我安装了TDM-GCC-64和OpenSSL,使用regedit将它们的/bin目录添加到PATH(以及OpenSSL的/lib目录)
1.第一个月
conda install theano
(同时安装所有mingw库)1.在这一点上-它工作-所以我没有使用任何
.theanorc.txt
文件配置,没有摆弄Windows环境变量。它甚至适用于基于keras的python脚本,即使我没有安装keras到我的conda venv中,它正在工作.(我在我的“正常”非conda python3中安装了keras,后来我也在我的conda venv下安装了keras)。n3h0vuf25#
很晚了,但供将来参考。我偶然发现这个线程试图在CPU上运行OpenBLAS测试脚本。它在GPU上运行良好,但CPU给我的错误与OP相同。我尝试了这里的建议,但没有工作。原来.theanorc中的行:
字符串
在bin之后和-l之前不应该有空格。所以应该是:
型
现在一切正常。试过了:
型
4ktjp1zp6#
我有这个问题,我得到这个解决方案,安装后theano,我再次重新安装numpy。我解决了这个问题
pip uninstall numpy
pip安装numpy