{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/929","labels_url":"https://api.github.com/repos/fchollet/keras/issues/929/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/929/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/929/events","html_url":"https://github.com/fchollet/keras/issues/929","id":114474325,"number":929,"title":"Cannot allocate memory when compiling a CNN.","user":{"login":"KeironO","id":4386515,"avatar_url":"https://avatars.githubusercontent.com/u/4386515?v=3","gravatar_id":"","url":"https://api.github.com/users/KeironO","html_url":"https://github.com/KeironO","followers_url":"https://api.github.com/users/KeironO/followers","following_url":"https://api.github.com/users/KeironO/following{/other_user}","gists_url":"https://api.github.com/users/KeironO/gists{/gist_id}","starred_url":"https://api.github.com/users/KeironO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KeironO/subscriptions","organizations_url":"https://api.github.com/users/KeironO/orgs","repos_url":"https://api.github.com/users/KeironO/repos","events_url":"https://api.github.com/users/KeironO/events{/privacy}","received_events_url":"https://api.github.com/users/KeironO/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-01T15:03:42Z","updated_at":"2015-11-03T05:26:34Z","closed_at":"2015-11-03T05:26:34Z","body":"When I try to compile a CNN, I get the following error.\r\n\r\n```\r\nProblem occurred during compilation with the command line below:\r\n/usr/bin/g++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=corei7-avx -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -fPIC -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/theano/gof -fvisibility=hidden -o /home/keo7/.theano/compiledir_Linux-3.16--generic-x86_64-with-LinuxMint-17-qiana-x86_64-2.7.6-64/tmpoLIylz/e157ab2f3af867deb8b752fbf03a772b.so /home/keo7/.theano/compiledir_Linux-3.16--generic-x86_64-with-LinuxMint-17-qiana-x86_64-2.7.6-64/tmpoLIylz/mod.cpp -L/usr/lib -lpython2.7\r\nERROR (theano.gof.cmodule): [Errno 12] Cannot allocate memory\r\nTraceback (most recent call last):\r\n  File \"all_test_run.py\", line 92, in <module>\r\n    conv_net = create_conv_net(number_classes)\r\n  File \"all_test_run.py\", line 74, in create_conv_net\r\n    conv_net.compile(loss=\"binary_crossentropy\", optimizer=stochastic_gradient_descent)\r\n  File \"/usr/local/lib/python2.7/dist-packages/keras/models.py\", line 399, in compile\r\n    allow_input_downcast=True, mode=theano_mode)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/compile/function.py\", line 308, in function\r\n    output_keys=output_keys)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/compile/pfunc.py\", line 526, in pfunc\r\n    output_keys=output_keys)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py\", line 1778, in orig_function\r\n    defaults)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py\", line 1642, in create\r\n    input_storage=input_storage_lists, storage_map=storage_map)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/link.py\", line 690, in make_thunk\r\n    storage_map=storage_map)[:3]\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/vm.py\", line 1037, in make_all\r\n    no_recycling))\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/tensor/elemwise.py\", line 815, in make_thunk\r\n    compute_map, no_recycling)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/op.py\", line 1154, in make_thunk\r\n    compute_map, no_recycling)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/op.py\", line 918, in make_thunk\r\n    no_recycling)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/op.py\", line 836, in make_c_thunk\r\n    output_storage=node_output_storage)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py\", line 1209, in make_thunk\r\n    keep_lock=keep_lock)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py\", line 1147, in __compile__\r\n    keep_lock=keep_lock)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py\", line 1604, in cthunk_factory\r\n    key=key, lnk=self, keep_lock=keep_lock)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/cmodule.py\", line 1174, in module_from_key\r\n    module = lnk.compile_cmodule(location)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/cc.py\", line 1515, in compile_cmodule\r\n    preargs=preargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/gof/cmodule.py\", line 2164, in compile_str\r\n    p_out = output_subprocess_Popen(cmd)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/misc/windows.py\", line 75, in output_subprocess_Popen\r\n    p = subprocess_Popen(command, **params)\r\n  File \"/usr/local/lib/python2.7/dist-packages/theano/misc/windows.py\", line 36, in subprocess_Popen\r\n    proc = subprocess.Popen(command, startupinfo=startupinfo, **params)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 710, in __init__\r\n    errread, errwrite)\r\n  File \"/usr/lib/python2.7/subprocess.py\", line 1223, in _execute_child\r\n    self.pid = os.fork()\r\nOSError: [Errno 12] Cannot allocate memory\r\n\r\n```\r\n\r\nAny help would be greatly appreciated!"},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/153245070","html_url":"https://github.com/fchollet/keras/issues/929#issuecomment-153245070","issue_url":"https://api.github.com/repos/fchollet/keras/issues/929","id":153245070,"user":{"login":"fchollet","id":710255,"avatar_url":"https://avatars.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T05:26:34Z","updated_at":"2015-11-03T05:26:34Z","body":"If on GPU (which is almost certainly the case): your network simply doesn't fit on your GPU memory. You can either use a smaller network or buy a bigger GPU."}}