【问题标题】:ImportError: DLL load failed while importing moduleImportError:导入模块时DLL加载失败
【发布时间】:2020-08-21 00:19:30
【问题描述】:

我正在尝试运行从该站点下载的代码:http://deeplearning.net/tutorial/lstm.html 当我尝试运行它时,它说

model options {'dim_proj': 128, 'patience': 10, 'max_epochs': 100, 'dispFreq': 10, 'decay_c': 0.0, 'lrate': 0.0001, 'n_words': 10000, 'optimizer': <function adadelta at 0x2043DC40>, 'encoder': 'lstm', 'saveto': 'lstm_model.npz', 'validFreq': 370, 'saveFreq': 1110, 'maxlen': 100, 'batch_size': 16, 'valid_batch_size': 64, 'dataset': 'imdb', 'noise_std': 0.0, 'use_dropout': True, 'reload_model': None, 'test_size': 500}
Loading data
Building model
Traceback (most recent call last):
  File "C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py", line 661, in <module>
    train_lstm(
  File "C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py", line 517, in train_lstm
    y, f_pred_prob, f_pred, cost) = build_model(tparams, model_options)
  File "C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py", line 395, in build_model
    proj = dropout_layer(proj, use_noise, trng)
  File "C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py", line 84, in dropout_layer
    trng.binomial(state_before.shape,
  File "C:\Python3\lib\site-packages\theano\sandbox\rng_mrg.py", line 901, in binomial
    x = self.uniform(size=size, nstreams=nstreams, **kwargs)
  File "C:\Python3\lib\site-packages\theano\sandbox\rng_mrg.py", line 872, in uniform
    rstates = self.get_substream_rstates(nstreams, dtype)
  File "C:\Python3\lib\site-packages\theano\configparser.py", line 117, in res
    return f(*args, **kwargs)
  File "C:\Python3\lib\site-packages\theano\sandbox\rng_mrg.py", line 779, in get_substream_rstates
    multMatVect(rval[0], A1p72, M1, A2p72, M2)
  File "C:\Python3\lib\site-packages\theano\sandbox\rng_mrg.py", line 61, in multMatVect
    multMatVect.dot_modulo = function(
  File "C:\Python3\lib\site-packages\theano\compile\function.py", line 306, in function
    fn = pfunc(params=inputs,
  File "C:\Python3\lib\site-packages\theano\compile\pfunc.py", line 483, in pfunc
    return orig_function(inputs, cloned_outputs, mode,
  File "C:\Python3\lib\site-packages\theano\compile\function_module.py", line 1841, in orig_function
    fn = m.create(defaults)
  File "C:\Python3\lib\site-packages\theano\compile\function_module.py", line 1714, in create
    _fn, _i, _o = self.linker.make_thunk(
  File "C:\Python3\lib\site-packages\theano\gof\link.py", line 697, in make_thunk
    return self.make_all(input_storage=input_storage,
  File "C:\Python3\lib\site-packages\theano\gof\vm.py", line 1087, in make_all
    thunks.append(node.op.make_thunk(node,
  File "C:\Python3\lib\site-packages\theano\gof\op.py", line 954, in make_thunk
    return self.make_c_thunk(node, storage_map, compute_map,
  File "C:\Python3\lib\site-packages\theano\gof\op.py", line 857, in make_c_thunk
    outputs = cl.make_thunk(input_storage=node_input_storage,
  File "C:\Python3\lib\site-packages\theano\gof\cc.py", line 1215, in make_thunk
    cthunk, module, in_storage, out_storage, error_storage = self.__compile__(
  File "C:\Python3\lib\site-packages\theano\gof\cc.py", line 1153, in __compile__
    thunk, module = self.cthunk_factory(error_storage,
  File "C:\Python3\lib\site-packages\theano\gof\cc.py", line 1623, in cthunk_factory
    module = get_module_cache().module_from_key(
  File "C:\Python3\lib\site-packages\theano\gof\cmodule.py", line 1189, in module_from_key
    module = lnk.compile_cmodule(location)
  File "C:\Python3\lib\site-packages\theano\gof\cc.py", line 1520, in compile_cmodule
    module = c_compiler.compile_str(
  File "C:\Python3\lib\site-packages\theano\gof\cmodule.py", line 2420, in compile_str
    return dlimport(lib_filename)
  File "C:\Python3\lib\site-packages\theano\gof\cmodule.py", line 317, in dlimport
    rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed while importing m75022cac696dc858984a7c4467166cc6915405b19d04c2580f5acf71c834d9de: The specified module could not be found.[Finished in 9.9s]

所以这个“m75022cac696dc858984a7c4467166cc6915405b19d04c2580f5acf71c834d9de”让我想知道这是什么类型的dll......任何帮助将不胜感激。

【问题讨论】:

    标签: python python-3.x theano


    【解决方案1】:

    由于直到现在仍未得到答复,我在 Win10 上的 Jupyter Notebook 上使用 Theano 进行培训时遇到了类似的问题,因为我正在使用 pip 安装软件包。

    我的解决方案是使用conda install theano 安装 Theano,它安装了各种额外的包,最终使 Theano 工作。我在 Ubuntu Google Cloud VM 上使用了同一个 Jupyter Notebook,我不必解决这个问题。

    【讨论】:

      猜你喜欢
      • 2020-03-31
      • 2021-07-25
      • 2021-04-17
      • 1970-01-01
      • 2012-02-02
      • 1970-01-01
      • 2022-10-12
      • 2020-05-15
      • 1970-01-01
      相关资源
      最近更新 更多