Python 导入错误:导入模块时DLL加载失败

Python 导入错误:导入模块时DLL加载失败,python,python-3.x,theano,Python,Python 3.x,Theano,我正在尝试运行从该网站下载的代码: 当我试着运行它时,它说 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': 'ls

我正在尝试运行从该网站下载的代码: 当我试着运行它时,它说

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]
模型选项{'dim_proj':128,'patience':10,'max_epochs':100,'disprefq':10,'decation_c':0.0,'lrate':0.0001,'n_words':10000,'optimizer':,'encoder':'lstm','saveto':'lstm_model.npz','validFreq':370 saveFreq':1110,'maxlen':100,'batch_size':16,'valid_batch_batch_size':64,'dataset':'imdb','noise std':0.0,'use dropout':True,'reload无,“测试大小”:500}
加载数据
建筑模型
回溯(最近一次呼叫最后一次):
文件“C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py”,第661行,在
火车头(
文件“C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py”,第517行,列车\lstm中
y、 f_pred_prob,f_pred,cost)=构建模型(图、模型选项)
文件“C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py”,第395行,内置模型
proj=衰减层(proj,使用噪声,trng)
文件“C:\Users\KaguyaHour\Desktop\PythonBin\lstm.py”,第84行,在退出层
试验二项式(形状前的状态),
文件“C:\Python3\lib\site packages\theano\sandbox\rng\u mrg.py”,第901行,二项式
x=自均匀(大小=大小,N流=N流,**kwargs)
文件“C:\Python3\lib\site packages\theano\sandbox\rng_mrg.py”,第872行,统一格式
rstates=self.get_substream_rstates(nstreams,dtype)
文件“C:\Python3\lib\site packages\theano\configparser.py”,第117行,res
返回f(*args,**kwargs)
文件“C:\Python3\lib\site packages\theano\sandbox\rng\u mrg.py”,第779行,在get\u substream\r状态中
多目标(rval[0],A1p72,M1,A2p72,M2)
文件“C:\Python3\lib\site packages\theano\sandbox\rng\u mrg.py”,第61行,在multMatVect中
multMatVect.dot_模=函数(
函数中第306行的文件“C:\Python3\lib\site packages\theano\compile\function.py”
fn=pfunc(参数=输入,
文件“C:\Python3\lib\site packages\theano\compile\pfunc.py”,第483行,在pfunc中
返回原始功能(输入、克隆输出、模式、,
文件“C:\Python3\lib\site packages\theano\compile\function\u module.py”,第1841行,在orig\u函数中
fn=m.create(默认值)
文件“C:\Python3\lib\site packages\theano\compile\function\u module.py”,第1714行,在create中
_fn,_i,_o=self.linker.make\u thunk(
文件“C:\Python3\lib\site packages\theano\gof\link.py”,第697行,make\u thunk
返回self.make_all(输入存储=输入存储,
文件“C:\Python3\lib\site packages\theano\gof\vm.py”,第1087行,make\u all
追加(node.op.make_thunk)(node,
文件“C:\Python3\lib\site packages\theano\gof\op.py”,第954行,make\u thunk
返回self.make_c_thunk(节点、存储映射、计算映射、,
文件“C:\Python3\lib\site packages\theano\gof\op.py”,第857行,make\u C\u thunk
输出=cl.make\u thunk(输入存储=节点输入存储,
文件“C:\Python3\lib\site packages\theano\gof\cc.py”,第1215行,make\u thunk
cthunk,模块,输入存储,输出存储,错误存储=self.\uu编译__(
文件“C:\Python3\lib\site packages\theano\gof\cc.py”,第1153行,在编译中__
thunk,module=self.cthunk\u工厂(错误存储,
文件“C:\Python3\lib\site packages\theano\gof\cc.py”,第1623行,在cthunk_工厂中
module=get_module_cache().module_from_key(
文件“C:\Python3\lib\site packages\theano\gof\cmodule.py”,第1189行,在模块\u中,从\u键开始
模块=lnk.编译模块(位置)
文件“C:\Python3\lib\site packages\theano\gof\cc.py”,第1520行,在compile\u cmodule中
module=c_compiler.compile_str(
文件“C:\Python3\lib\site packages\theano\gof\cmodule.py”,第2420行,在compile\u str中
返回dlimport(lib_文件名)
dlimport中第317行的文件“C:\Python3\lib\site packages\theano\gof\cmodule.py”
rval=uuu导入(模块名称,{},{},{},[模块名称])
导入错误:导入m75022cac696dc858984a7c4467166cc6915405b19d04c2580f5acf71c834d9de时DLL加载失败:找不到指定的模块。[在9.9秒内完成]

因此,这个“m75022cac696dc858984a7c4467166cc6915405b19d04c2580f5acf71c834d9de”让我想知道它是什么类型的dll…任何帮助都将不胜感激。

因为到目前为止还没有答案,我在Win10上运行Jupyter笔记本上的Theano训练时遇到了类似的问题,因为我正在安装带有pip的软件包


我的解决方案是使用conda install Theano安装Theano,它安装了各种附加软件包,最终使Theano正常工作。我在Ubuntu Google Cloud VM上使用了相同的Jupyter笔记本,我不必解决这个问题。

因为到目前为止还没有答案,所以我在运行tr时遇到了类似的问题在Win10上的Jupyter笔记本上使用Theano,因为我正在安装带有pip的软件包

我的解决方案是用
conda install Theano
安装Theano,它安装了各种附加软件包,最终使Theano正常工作。我在Ubuntu Google Cloud VM上使用了相同的Jupyter笔记本,我不必解决这个问题