将Conv2DLayer与烤宽面条NeuralNet一起使用时出错 [英] Error while using Conv2DLayer with lasagne NeuralNet

查看:98
本文介绍了将Conv2DLayer与烤宽面条NeuralNet一起使用时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有64位Windows 8.1,并在这里推荐使用 http://deeplearning.net /software/theano/install_windows.html#installing-theano python win-python发行版(python 3.4).我遍历了教程的每个步骤(不包括CUDA内容和GPU配置),卸载了所有内容并再次进行了操作,但问题仍然存在.我正在尝试使用千层面构建卷积神经网络.到目前为止,我测试过的每一层都在工作-只有Conv2DLayer会引发错误.代码如下:

I have windows 8.1 64bit and use recommended here http://deeplearning.net/software/theano/install_windows.html#installing-theano python win-python distribution (python 3.4). I've went through every step of tutorial (excluding CUDA stuff and GPU config), uninstalled everything and did it again but my problem persists. I am trying to build convolutional neural network using Lasagne. Every layer I've tested so far is working - only Conv2DLayer throws errors. Code is as follows:

net2 = NeuralNet(
layers=[
    ('input', layers.InputLayer),
    ('conv1', layers.Conv2DLayer),
    ('pool1', layers.MaxPool2DLayer),
    ('hidden4', layers.DenseLayer),
    ('hidden5', layers.DenseLayer),
    ('output', layers.DenseLayer),
    ],
input_shape=(None, 1, 96, 96),
conv1_num_filters=32, conv1_filter_size=(3, 3),
pool1_pool_size=(2, 2),
hidden4_num_units=500, hidden5_num_units=500,
output_num_units=30, output_nonlinearity=None,
update_learning_rate=0.01,
update_momentum=0.9,
regression=True,
max_epochs=400,
verbose=1,
)

下面,我粘贴了我得到的错误.我想gcc出了点问题(我从教程中获得了确切的版本),但无法真正找出问题所在.我的烤宽面条/theano的边缘版本令人流血.我已经尝试了Anaconda和WinPython发行版.我已经尝试使用python 2.7和3.4两者,但实际上并没有找到解决此问题的任何方法.仅具有密集/最大池层的网络运行良好.对于能帮助我解决此问题的任何建议,我将不胜感激.

Below I have pasted the error that I get. I suppose that something is wrong with gcc (I got exact version from tutorial) but can't really figure out what is the problem. I have bleeding edge versions of lasagne/theano. I've tried both Anaconda and WinPython distributions. I've tried both with python 2.7 and 3.4 and can not really find any solution to this problem. Nets with only dense/maxPooling layers are running just fine. I would be grateful for any suggestions that would help me to resolve this issue.

错误消息:


Problem occurred during compilation with the command line below:
g++.exe -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=haswell -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -IC:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\numpy\core\include -IC:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\include -IC:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof -o C:\Users\Michal\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\tmpgdh7ov2i\mf217e5b3a6b61b4ef70844368439f6cb.pyd C:\Users\Michal\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\tmpgdh7ov2i\mod.cpp -LC:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\libs -LC:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64 -lpython34
Traceback (most recent call last):

  File "", line 1, in 
    net2.fit(X, y)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\nolearn\lasagne\base.py", line 457, in fit
    self.initialize()

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\nolearn\lasagne\base.py", line 303, in initialize
    self.y_tensor_type,

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\nolearn\lasagne\base.py", line 435, in _create_iter_funcs
    allow_input_downcast=True,

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\compile\function.py", line 317, in function
    output_keys=output_keys)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\compile\pfunc.py", line 526, in pfunc
    output_keys=output_keys)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\compile\function_module.py", line 1778, in orig_function
    defaults)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\compile\function_module.py", line 1642, in create
    input_storage=input_storage_lists, storage_map=storage_map)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\link.py", line 690, in make_thunk
    storage_map=storage_map)[:3]

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\vm.py", line 1037, in make_all
    no_recycling))

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\op.py", line 932, in make_thunk
    no_recycling)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\op.py", line 850, in make_c_thunk
    output_storage=node_output_storage)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\cc.py", line 1207, in make_thunk
    keep_lock=keep_lock)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\cc.py", line 1152, in __compile__
    keep_lock=keep_lock)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\cc.py", line 1602, in cthunk_factory
    key=key, lnk=self, keep_lock=keep_lock)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\cmodule.py", line 1174, in module_from_key
    module = lnk.compile_cmodule(location)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\cc.py", line 1513, in compile_cmodule
    preargs=preargs)

  File "C:\scisoft\WinPython-64bit-3.4.3.7\python-3.4.3.amd64\lib\site-packages\theano\gof\cmodule.py", line 2187, in compile_str
    (status, compile_stderr.replace('\n', '. ')))

Exception: ('The following error happened while compiling the node', CorrMM{valid, (1, 1)}(input.input, Subtensor{::, ::, ::int64, ::int64}.0), '\n', "Compilation failed (return status=1): C:\\Users\\Michal\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\\tmpgdh7ov2i\\mod.cpp: In member function 'int {anonymous}::__struct_compiled_op_mf217e5b3a6b61b4ef70844368439f6cb::run()':\r. C:\\Users\\Michal\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\\tmpgdh7ov2i\\mod.cpp:947:16: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]\r.              kH = NULL;\r.                 ^\r. C:\\Users\\Michal\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\\tmpgdh7ov2i\\mod.cpp:958:16: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]\r.              kW = NULL;\r.                 ^\r. C:\\Users\\Michal\\AppData\\Local\\Temp\\cc67su6o.o: In function `corrMM(tagPyArrayObject*, tagPyArrayObject*, tagPyArrayObject*, int, int, int, int, int)':\r. C:/Users/Michal/AppData/Local/Theano/compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64/tmpgdh7ov2i/mod.cpp:431: undefined reference to `dgemm_'\r. C:/Users/Michal/AppData/Local/Theano/compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64/tmpgdh7ov2i/mod.cpp:528: undefined reference to `dgemm_'\r. C:/Users/Michal/AppData/Local/Theano/compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64/tmpgdh7ov2i/mod.cpp:483: undefined reference to `dgemm_'\r. collect2.exe: error: ld returned 1 exit status\r. ", '[CorrMM{valid, (1, 1)}(input.input, )]')

推荐答案

我设法按照IshanAntony在此网站上给出的步骤来解决我的问题

I managed to solve my issue by following steps given by IshanAntony on this website https://www.kaggle.com/c/otto-group-product-classification-challenge/forums/t/13973/a-few-tips-to-install-theano-on-windows-64-bits/98833 . Apparently Theano had problem with linking BLAS correctly so I downloaded and used open-BLAS and error vanished (links and steps needed to download and configure OPEN-BLAS can be found in IshanAntony's answer).

这篇关于将Conv2DLayer与烤宽面条NeuralNet一起使用时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆