在Windows 10上为Theano安装TDM-GCC / OpenBLAS的麻烦 - DLL加载失败

时间:2017-07-28 16:03:15

标签: gcc theano openblas

如果不使用C ++编译器,我的设置(见下文)效果很好(但当然很慢)。 为了加快运行时间,我尝试安装TDM-GCC。然后显示导入错误“DLL加载失败”。 花了几个小时阅读安装指南,下载OpenBLAS,试验,阅读问题/评论到“DLL加载失败” - 我没有前进一步。 任何人都可以帮助我吗?

已安装的软件:

  • Windows 10 Home

  • Python 3.6.1(v3.6.1:69c0db5,2017年3月21日,18:41:36)[MSC v.1900 64 bit(AMD64)] on win32

  • numpy(1.13.0rc2 + mkl)(安装为方向盘)

  • scipy(0.19.0)(安装为方向盘)
  • scikit-learn(0.18.1)(安装为轮子)
  • Theano(0.9.0)
  • Keras(2.0.6)

  • gcc版本5.1.0(tdm64-1)

  • OpenBLAS-v0.2.19-Win64的-INT32

我在路径中添加了以下条目:

C:\Python36\
C:\TDM-GCC-64\bin\
C:\TDM-GCC-64\x86_64-w64-mingw32\bin\
C:\TDM-GCC-64\x86_64-w64-mingw32\lib\
C:\TDM-GCC-64\lib\gcc\x86_64-w64-mingw32\5.1.0\
C:\TDM-GCC-64\libexec\gcc\x86_64-w64-mingw32\5.1.0\
C:\OpenBLAS-v0.2.19-Win64-int32\bin\
C:\OpenBLAS-v0.2.19-Win64-int32\lib\

我的theaonrc.txt看起来像这样:

[global]
floatX = float32
device = cpu
cxx=C:\\TDM-GCC-64\\bin\\g++.exe

[blas]
ldflags = -LC:\\OpenBLAS-v0.2.19-Win64-int32\\bin -LC:\\OpenBLAS-v0.2.19-  Win64-int32\\lib -lopenblas

错误日志:

Using Theano backend.
WARNING (theano.gof.compilelock): Overriding existing lock by dead process '1004' (I am process '6472')
Traceback (most recent call last):
  File "C:/Christian/Python/DL.py", line 15, in <module>
model.add(Dense(12, input_dim=8, activation='relu'))
  File "C:\Python36\lib\site-packages\keras\models.py", line 436, in add
layer(x)
  File "C:\Python36\lib\site-packages\keras\engine\topology.py", line 569, in __call__
self.build(input_shapes[0])
  File "C:\Python36\lib\site-packages\keras\layers\core.py", line 825, in build
constraint=self.kernel_constraint)
  File "C:\Python36\lib\site-packages\keras\legacy\interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
  File "C:\Python36\lib\site-packages\keras\engine\topology.py", line 391, in add_weight
weight = K.variable(initializer(shape), dtype=dtype, name=name)
  File "C:\Python36\lib\site-packages\keras\initializers.py", line 208, in __call__
dtype=dtype, seed=self.seed)
  File "C:\Python36\lib\site-packages\keras\backend\theano_backend.py", line 2191, in random_uniform
return rng.uniform(shape, low=minval, high=maxval, dtype=dtype)
  File "C:\Python36\lib\site-packages\theano\sandbox\rng_mrg.py", line 1354, in uniform
rstates = self.get_substream_rstates(nstreams, dtype)
  File "C:\Python36\lib\site-packages\theano\configparser.py", line 117, in res
return f(*args, **kwargs)
  File "C:\Python36\lib\site-packages\theano\sandbox\rng_mrg.py", line 1256, in get_substream_rstates
multMatVect(rval[0], A1p72, M1, A2p72, M2)
  File "C:\Python36\lib\site-packages\theano\sandbox\rng_mrg.py", line 66, in multMatVect
[A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym], o, profile=False)
  File "C:\Python36\lib\site-packages\theano\compile\function.py", line 326, in function
output_keys=output_keys)
  File "C:\Python36\lib\site-packages\theano\compile\pfunc.py", line 486, in pfunc
output_keys=output_keys)
  File "C:\Python36\lib\site-packages\theano\compile\function_module.py", line 1795, in orig_function
defaults)
  File "C:\Python36\lib\site-packages\theano\compile\function_module.py", line 1661, in create
input_storage=input_storage_lists, storage_map=storage_map)
  File "C:\Python36\lib\site-packages\theano\gof\link.py", line 699, in make_thunk
storage_map=storage_map)[:3]
  File "C:\Python36\lib\site-packages\theano\gof\vm.py", line 1047, in make_all
impl=impl))
  File "C:\Python36\lib\site-packages\theano\gof\op.py", line 935, in make_thunk
no_recycling)
  File "C:\Python36\lib\site-packages\theano\gof\op.py", line 839, in make_c_thunk
output_storage=node_output_storage)
  File "C:\Python36\lib\site-packages\theano\gof\cc.py", line 1190, in make_thunk
keep_lock=keep_lock)
  File "C:\Python36\lib\site-packages\theano\gof\cc.py", line 1131, in __compile__
keep_lock=keep_lock)
  File "C:\Python36\lib\site-packages\theano\gof\cc.py", line 1586, in cthunk_factory
key=key, lnk=self, keep_lock=keep_lock)
  File "C:\Python36\lib\site-packages\theano\gof\cmodule.py", line 1159, in module_from_key
module = lnk.compile_cmodule(location)
  File "C:\Python36\lib\site-packages\theano\gof\cc.py", line 1489, in compile_cmodule
preargs=preargs)
  File "C:\Python36\lib\site-packages\theano\gof\cmodule.py", line 2325, in compile_str
return dlimport(lib_filename)
  File "C:\Python36\lib\site-packages\theano\gof\cmodule.py", line 302, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed: Eine DLL-Initialisierungsroutine ist fehlgeschlagen.

1 个答案:

答案 0 :(得分:0)

我放弃了,卸载了我的设置并安装了Anaconda - 现在它可以工作: - )

为了安装Anaconda,我使用了指南https://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda/