- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试在 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
中设置断点,但没有命中。
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 所附的指南。
关于python - 在 Windows 上安装 Theano - DLL 加载失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34508431/
如何通过索引向量在 Theano 中索引矩阵? 更准确地说: v 的类型为 theano.tensor.vector(例如 [0,2]) A 具有 theano.tensor.matrix 类型(例如
我是theano的新手。我正在尝试实现简单的线性回归,但我的程序抛出以下错误: TypeError: ('Bad input argument to theano function with name
我有一个被多次调用的 Theano 函数,每次都使用不同的共享变量。按照现在的实现方式,Theano 函数在每次运行时都会重新定义。我假设,这会使整个程序变慢,因为每次定义 Theano 函数时,都会
我正在阅读http://deeplearning.net/tutorial/logreg.html给出的逻辑函数代码。我对函数的inputs和givens变量之间的区别感到困惑。计算微型批次中的模型所
我是 Theano 的新手。 尝试设置配置文件。 首先,我注意到我没有 .theanorc 文件: locate .theanorc - 不返回任何内容 echo $THEANORC - 不返回任何内
我不明白为什么我们在 Theano 中需要 tensor.reshape() 函数。文档中说: Returns a view of this tensor that has been reshaped
给定一个张量 v = t.vector(),我该如何翻转它?例如,[1, 2, 3, 4, 5, 6] 翻转后是 [6, 5, 4, 3, 2, 1]。 最佳答案 您可以简单地执行 v[::-1].e
我是 Theano 的新手,正在尝试一些示例。 import numpy import theano.tensor as T from theano import function import da
出于诊断目的,我定期获取网络的梯度。一种方法是将梯度作为 theano 函数的输出返回。然而,每次都将梯度从 GPU 复制到 CPU 内存可能代价高昂,所以我宁愿只定期进行。目前,我通过创建两个函数对
我阅读了网络上所有关于人们忘记将目标向量更改为矩阵的问题的帖子,由于更改后问题仍然存在,我决定在这里提出我的问题。下面提到了解决方法,但出现了新问题,我感谢您的建议! 使用卷积网络设置和带有 sigm
我需要通过扫描多次执行 theano 函数,以便总结成本函数并将其用于梯度计算。我熟悉执行此操作的深度学习教程,但我的数据切片和其他一些复杂情况意味着我需要做一些不同的事情。 下面是我正在尝试做的一个
我正在尝试学习(和比较)不同的深度学习框架,到时候它们是 Caffe 和 Theano。 http://caffe.berkeleyvision.org/gathered/examples/mnist
下面的代码: import theano import numpy as np from theano import tensor as T h1=T.as_tensor_variable(np.ze
我发现 Theano/Lasagne 的所有示例都处理像 mnist 和 cifar10 这样的小数据集,它们可以完全加载到内存中。 我的问题是如何编写高效的代码来训练大规模数据集?具体来说,为了让
我正在做图像分类,我必须检测图像是否包含飞机。 我完成了以下步骤: 1. 从图像数据集中提取特征作为描述符 2. 用 K 完成 - 表示聚类并生成描述符语料库 3.将语料数据在0-1范围内归一化并保存
一些简单的 theano 代码完美运行,当我导入 pymc3 时停止运行 为了重现错误,这里有一些片段: #Initial Theano Code (this works) import the
我在做this对于 NumPy 。 seq 是一个带有索引的列表。 IE。这实现了 1-of-k 编码(也称为 one-hot)。 def 1_of_k(seq, num_classes): nu
Keras 将数据批量加载到 GPU 上(作者注明here)。 对于小型数据集,这是非常低效的。有没有办法修改 Keras 或直接调用 Theano 函数(在 Keras 中定义模型之后)以允许将所有
Theano导入失败,theano配置cnmem = 1 知道如何确保 GPU 完全分配给 theano python 脚本吗? Note: Display is not used to avoid
例如,我可以定义一个递归 Python lambda 函数来计算斐波那契数列,如下所示: fn = lambda z: fn(z-1)+fn(z-2) if z > 1 else z 但是,如果我尝试
我是一名优秀的程序员,十分优秀!