{"action":"created","issue":{"url":"https://api.github.com/repos/jcjohnson/neural-style/issues/44","labels_url":"https://api.github.com/repos/jcjohnson/neural-style/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/jcjohnson/neural-style/issues/44/comments","events_url":"https://api.github.com/repos/jcjohnson/neural-style/issues/44/events","html_url":"https://github.com/jcjohnson/neural-style/issues/44","id":106917177,"number":44,"title":"OpenCL support","user":{"login":"napsternxg","id":112678,"avatar_url":"https://avatars.githubusercontent.com/u/112678?v=3","gravatar_id":"","url":"https://api.github.com/users/napsternxg","html_url":"https://github.com/napsternxg","followers_url":"https://api.github.com/users/napsternxg/followers","following_url":"https://api.github.com/users/napsternxg/following{/other_user}","gists_url":"https://api.github.com/users/napsternxg/gists{/gist_id}","starred_url":"https://api.github.com/users/napsternxg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/napsternxg/subscriptions","organizations_url":"https://api.github.com/users/napsternxg/orgs","repos_url":"https://api.github.com/users/napsternxg/repos","events_url":"https://api.github.com/users/napsternxg/events{/privacy}","received_events_url":"https://api.github.com/users/napsternxg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":50,"created_at":"2015-09-17T05:54:28Z","updated_at":"2015-09-20T02:16:10Z","closed_at":null,"body":"I tried implementing OpenCL support and the code is at: https://github.com/napsternxg/neural-style/tree/opencl\r\n\r\nHowever I get the following error when running the code:\r\n\r\n```\r\n$ $ th neural_style_opencl.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg -gpu 0 -backend 'clnn' -output_image profile.png\r\n[libprotobuf WARNING google/protobuf/io/coded_stream.cc:505] Reading dangerously large protocol message.  If the message turns out to be larger than 1073741824 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.\r\n[libprotobuf WARNING google/protobuf/io/coded_stream.cc:78] The total number of bytes read was 574671192\r\nSuccessfully loaded models/VGG_ILSVRC_19_layers.caffemodel\r\nconv1_1: 64 3 3 3\r\nconv1_2: 64 64 3 3\r\nconv2_1: 128 64 3 3\r\nconv2_2: 128 128 3 3\r\nconv3_1: 256 128 3 3\r\nconv3_2: 256 256 3 3\r\nconv3_3: 256 256 3 3\r\nconv3_4: 256 256 3 3\r\nconv4_1: 512 256 3 3\r\nconv4_2: 512 512 3 3\r\nconv4_3: 512 512 3 3\r\nconv4_4: 512 512 3 3\r\nconv5_1: 512 512 3 3\r\nconv5_2: 512 512 3 3\r\nconv5_3: 512 512 3 3\r\nconv5_4: 512 512 3 3\r\nfc6: 1 1 25088 4096\r\nfc7: 1 1 4096 4096\r\nfc8: 1 1 4096 1000\r\nUsing Advanced Micro Devices, Inc. , OpenCL platform: AMD Accelerated Parallel Processing\r\nUsing OpenCL device: Turks\r\n/home/torch/install/bin/luajit: C++ exception\r\n```\r\n\r\nI believe the issue is because of the SpatialConvolutionMM which is implemented in ccn2 module. "},"comment":{"url":"https://api.github.com/repos/jcjohnson/neural-style/issues/comments/141729134","html_url":"https://github.com/jcjohnson/neural-style/issues/44#issuecomment-141729134","issue_url":"https://api.github.com/repos/jcjohnson/neural-style/issues/44","id":141729134,"user":{"login":"hughperkins","id":123560,"avatar_url":"https://avatars.githubusercontent.com/u/123560?v=3","gravatar_id":"","url":"https://api.github.com/users/hughperkins","html_url":"https://github.com/hughperkins","followers_url":"https://api.github.com/users/hughperkins/followers","following_url":"https://api.github.com/users/hughperkins/following{/other_user}","gists_url":"https://api.github.com/users/hughperkins/gists{/gist_id}","starred_url":"https://api.github.com/users/hughperkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughperkins/subscriptions","organizations_url":"https://api.github.com/users/hughperkins/orgs","repos_url":"https://api.github.com/users/hughperkins/repos","events_url":"https://api.github.com/users/hughperkins/events{/privacy}","received_events_url":"https://api.github.com/users/hughperkins/received_events","type":"User","site_admin":false},"created_at":"2015-09-20T02:16:10Z","updated_at":"2015-09-20T02:16:10Z","body":"Hmmm.  Can you open your installed Sequential.lua file, like `gedit /home/user/torch/install/share/lua/5.1/nn/Sequential.lua`, and hack the updateOutput function a bit, to look as follows please:\r\n\r\n```\r\nfunction Sequential:updateOutput(input)\r\n   print('input:size()', input:size())\r\n   local currentOutput = input\r\n   for i=1,#self.modules do\r\n      print('currentOutput:size()', currentOutput:size())\r\n      print('self.modules[', i , ']=', self.modules[i])\r\n      currentOutput = self.modules[i]:updateOutput(currentOutput)\r\n   end\r\n   self.output = currentOutput\r\n   return currentOutput\r\nend\r\n```\r\nThis will give us a bit more information about what is arriving and so on.  (To revert the change later, simply reinstall `nn` library)."}}