python - Unable to run the Theano CNN.py file for a different dataset -
i have converted dataset in form of mnist.pkl.gz file , runs logistic_sgd.py , mlp.py programs given in theano deeplearning tutorial pdf (university of montreal). on running cnn.py file gives huge error difficult understand. can has succesfully run cnn.py program different dataset me out here totally clueless error is. training set has 1176 entries , validation , test set has 168 entries each. maybe problem batch size. if can please suggest me appropriate batch size?
i using spyder gui python 2.7 comes anaconda bundle.
error occurs after printing '... building model'
code snippet:
print '... building model' # reshape matrix of rasterized images of shape (batch_size, 28 * 28) # 4d tensor, compatible our lenetconvpoollayer # (28, 28) size of mnist images. layer0_input = x.reshape((batch_size, 1, 28, 28)) # construct first convolutional pooling layer: # filtering reduces image size (28-5+1 , 28-5+1) = (24, 24) # maxpooling reduces further (24/2, 24/2) = (12, 12) # 4d output tensor of shape (batch_size, nkerns[0], 12, 12) layer0 = lenetconvpoollayer( rng, input=layer0_input, image_shape=(batch_size, 1, 28, 28), filter_shape=(nkerns[0], 1, 5, 5), poolsize=(2, 2) )
prompt @ console error occurs:
... bulding modelwarning (theano.gof.compilelock): overriding existing lock dead process '4396'(i process '3624') warning:theano.gof.compilelock:overriding exisiting lock dead process '4396' (i process '3624')
then following error message appears.
error message:
traceback (most recent call last): file "<ipython-input-17-931f7529f484>", line 1, in <module> runfile('c:/users/pratik18v/documents/python scripts/cnn.py', wdir='c:/users/pratik18v/documents/python scripts') file "c:\users\pratik18v\anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 682, in runfile execfile(filename, namespace) file "c:\users\pratik18v\anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc) file "c:/users/pratik18v/documents/python scripts/cnn.py", line 339, in <module> evaluate_lenet5() file "c:/users/pratik18v/documents/python scripts/cnn.py", line 218, in evaluate_lenet5 y: test_set_y[index * batch_size: (index + 1) * batch_size] file "c:\users\pratik18v\anaconda\lib\site-packages\theano\compile\function.py", line 266, in function profile=profile) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\compile\pfunc.py", line 511, in pfunc on_unused_input=on_unused_input) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\compile\function_module.py", line 1466, in orig_function defaults) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\compile\function_module.py", line 1324, in create input_storage=input_storage_lists) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\link.py", line 519, in make_thunk output_storage=output_storage)[:3] file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\vm.py", line 897, in make_all no_recycling)) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\op.py", line 1002, in make_thunk compute_map, no_recycling) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\op.py", line 739, in make_thunk output_storage=node_output_storage) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\cc.py", line 1073, in make_thunk keep_lock=keep_lock) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\cc.py", line 1015, in __compile__ keep_lock=keep_lock) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\cc.py", line 1442, in cthunk_factory key=key, lnk=self, keep_lock=keep_lock) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\cmodule.py", line 1076, in module_from_key module = lnk.compile_cmodule(location) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\cc.py", line 1354, in compile_cmodule preargs=preargs) file "c:\users\pratik18v\anaconda\lib\site-packages\theano\gof\cmodule.py", line 2010, in compile_str (status, compile_stderr.replace('\n', '. '))) exception: ('the following error happened while compiling node', convop{('imshp', (1, 28, 28)),('kshp', (5, 5)),('nkern', 20),('bsize', 100),('dx', 1),('dy', 1),('out_mode', 'valid'),('unroll_batch', 5),('unroll_kern', 2),('unroll_patch', false),('imshp_logical', (1, 28, 28)),('kshp_logical', (5, 5)),('kshp_logical_top_aligned', true)}(reshape{4}.0, <tensortype(float64, 4d)>), '\n', "compilation failed (return status=1): c:\\users\\pratik~1\\appdata\\local\\temp\\cchtvcfs.o: in function `instantiate':\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:1128: undefined reference `__imp_pyexc_typeerror'\r. c:\\users\\pratik~1\\appdata\\local\\temp\\cchtvcfs.o: in function `run':\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:297: undefined reference `__imp__py_nonestruct'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:322: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:328: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:356: undefined reference `__imp_pyexc_notimplementederror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:393: undefined reference `__imp__py_nonestruct'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:408: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:442: undefined reference `__imp_pyexc_notimplementederror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:463: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:371: undefined reference `__imp_pyexc_typeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:377: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:1095: undefined reference `__imp__py_nonestruct'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:1094: undefined reference `__imp__py_nonestruct'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:1093: undefined reference `__imp__py_nonestruct'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:477: undefined reference `__imp__py_nonestruct'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:492: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:1058: undefined reference `__imp_pyexc_notimplementederror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:1029: undefined reference `__imp__py_nonestruct'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:1064: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:457: undefined reference `__imp_pyexc_typeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:526: undefined reference `__imp_pyexc_notimplementederror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:547: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:414: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:761: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:767: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:541: undefined reference `__imp_pyexc_typeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:620: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:903: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:599: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:605: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:782: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:803: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:835: undefined reference `__imp_pyexc_valueerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:498: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:897: undefined reference `__imp_pyexc_assertionerror'\r. c:/users/pratik18v/appdata/local/theano/compiledir_windows-8-6.2.9200-intel64_family_6_model_58_stepping_9_genuineintel-2.7.9-64/tmpjmrfis/mod.cpp:827: undefined reference `__imp_pyexc_valueerror'\r. c:\\users\\pratik~1\\appdata\\local\\temp\\cchtvcfs.o: in function `_import_array':\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1654: undefined reference `__imp_pycobject_type'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1655: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1656: undefined reference `__imp_pyexc_importerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1677: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1677: undefined reference `__imp_pyexc_importerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1636: undefined reference `__imp_pyexc_importerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1699: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1699: undefined reference `__imp_pyexc_importerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1642: undefined reference `__imp_pyexc_attributeerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1642: undefined reference `__imp_pyexc_importerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1663: undefined reference `__imp_pyexc_runtimeerror'\r. c:/users/pratik18v/anaconda/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h:1663: undefined reference `__imp_pyexc_importerror'\r. collect2.exe: error: ld returned 1 exit status\r. ", "[convop{('imshp', (1, 28, 28)),('kshp', (5, 5)),('nkern', 20),('bsize', 100),('dx', 1),('dy', 1),('out_mode', 'valid'),('unroll_batch', 5),('unroll_kern', 2),('unroll_patch', false),('imshp_logical', (1, 28, 28)),('kshp_logical', (5, 5)),('kshp_logical_top_aligned', true)}(<tensortype(float64, (false, true, false, false))>, <tensortype(float64, 4d)>)]")
i encouraged add more information (thanks that) felt obliged far can, unfortunately may not much. others can add better answers.
i don't think error occurring within code snippet provided. yes, it's after '... building model' message, think it's further on. it's generating error @ theano.function
call.
your problem appears in c++ toolchain on system. suggest searching more information respect "undefined reference __imp_pyexc_importerror" message.
for example, this stackoverflow question suggests adding -d ms_win64
command line. internal command line, not 1 using originally.
i don't understand why works 1 dataset not another.
Comments
Post a Comment