{"action":"created","issue":{"url":"https://api.github.com/repos/torch/tutorials/issues/43","repository_url":"https://api.github.com/repos/torch/tutorials","labels_url":"https://api.github.com/repos/torch/tutorials/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/torch/tutorials/issues/43/comments","events_url":"https://api.github.com/repos/torch/tutorials/issues/43/events","html_url":"https://github.com/torch/tutorials/issues/43","id":136011195,"number":43,"title":"MSECriterion error with cuda and double types and MultiMarginCriterion error with cuda","user":{"login":"zweifel","id":5179341,"avatar_url":"https://avatars.githubusercontent.com/u/5179341?v=3","gravatar_id":"","url":"https://api.github.com/users/zweifel","html_url":"https://github.com/zweifel","followers_url":"https://api.github.com/users/zweifel/followers","following_url":"https://api.github.com/users/zweifel/following{/other_user}","gists_url":"https://api.github.com/users/zweifel/gists{/gist_id}","starred_url":"https://api.github.com/users/zweifel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zweifel/subscriptions","organizations_url":"https://api.github.com/users/zweifel/orgs","repos_url":"https://api.github.com/users/zweifel/repos","events_url":"https://api.github.com/users/zweifel/events{/privacy}","received_events_url":"https://api.github.com/users/zweifel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T09:56:22Z","updated_at":"2016-03-11T14:16:02Z","closed_at":null,"body":"Setting the mse criterion in doall.lua causes error when the types are cuda or double.\r\nSettings:\r\n```\r\ncmd:option('-seed', 1, 'fixed input seed for repeatable experiments')\r\ncmd:option('-threads', 8, 'number of threads')\r\n-- data:\r\ncmd:option('-size', 'full', 'how many samples do we load: small | full | extra')\r\n-- model:\r\ncmd:option('-model', 'convnet', 'type of model to construct: linear | mlp | convnet')\r\n-- training:\r\ncmd:option('-save', 'results', 'subdirectory to save/log experiments in')\r\ncmd:option('-plot', false, 'live plot')\r\ncmd:option('-optimization', 'SGD', 'optimization method: SGD | ASGD | CG | LBFGS')\r\ncmd:option('-learningRate', 1e-3, 'learning rate at t=0')\r\ncmd:option('-batchSize', 1, 'mini-batch size (1 = pure stochastic)')\r\ncmd:option('-weightDecay', 0, 'weight decay (SGD only)')\r\ncmd:option('-momentum', 0, 'momentum (SGD only)')\r\ncmd:option('-t0', 1, 'start averaging at t0 (ASGD only), in nb of epochs')\r\ncmd:option('-maxIter', 2, 'maximum nb of iterations for CG and LBFGS')\r\n```\r\n\r\n\r\nError when the type is set to cuda:\r\n```\r\n/root/torch/install/share/lua/5.1/nn/THNN.lua:804: bad argument #3 to 'v' (cannot convert 'struct THFloatTensor *' to 'struct THCudaTensor *')\r\nstack traceback:\r\n\t[C]: in function 'v'\r\n\t/root/torch/install/share/lua/5.1/nn/THNN.lua:804: in function 'MSECriterion_updateOutput'\r\n\t/root/torch/install/share/lua/5.1/nn/MSECriterion.lua:14: in function 'forward'\r\n\t4_train.lua:161: in function 'opfunc'\r\n\t/root/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'\r\n\t4_train.lua:184: in function 'train'\r\n\tdoall.lua:80: in main chunk\r\n\t[C]: in function 'f'\r\n\t[string \"local f = function() return dofile('doall.lua...\"]:1: in main chunk\r\n\t[C]: in function 'xpcall'\r\n\t/root/torch/install/share/lua/5.1/itorch/main.lua:209: in function </root/torch/install/share/lua/5.1/itorch/main.lua:173>\r\n\t/root/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'\r\n\t/root/torch/install/share/lua/5.1/itorch/main.lua:381: in main chunk\r\n\t[C]: in function 'require'\r\n\t(command line):1: in main chunk\r\n\t[C]: at 0x00405bd0\r\n\r\n\r\n```\r\n\r\nError when set to double type:\r\n\r\n```\r\n/root/torch/install/share/lua/5.1/nn/THNN.lua:804: bad argument #3 to 'v' (cannot convert 'struct THFloatTensor *' to 'struct THDoubleTensor *')\r\nstack traceback:\r\n\t[C]: in function 'v'\r\n\t/root/torch/install/share/lua/5.1/nn/THNN.lua:804: in function 'SpatialConvolutionMM_updateOutput'\r\n\t.../torch/install/share/lua/5.1/nn/SpatialConvolutionMM.lua:72: in function 'updateOutput'\r\n\t/root/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'\r\n\t4_train.lua:160: in function 'opfunc'\r\n\t/root/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'\r\n\t4_train.lua:184: in function 'train'\r\n\tdoall.lua:80: in main chunk\r\n\t[C]: in function 'f'\r\n\t[string \"local f = function() return dofile('doall.lua...\"]:1: in main chunk\r\n\t[C]: in function 'xpcall'\r\n\t/root/torch/install/share/lua/5.1/itorch/main.lua:209: in function </root/torch/install/share/lua/5.1/itorch/main.lua:173>\r\n\t/root/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'\r\n\t/root/torch/install/share/lua/5.1/itorch/main.lua:381: in main chunk\r\n\t[C]: in function 'require'\r\n\t(command line):1: in main chunk\r\n\t[C]: at 0x00405bd0\r\n```\r\n\r\n\r\nMultiMarginCriterion error with cuda:\r\n```\r\n/root/torch/install/share/lua/5.1/nn/THNN.lua:804: wrong number of arguments for function call\r\nstack traceback:\r\n\t[C]: in function 'v'\r\n\t/root/torch/install/share/lua/5.1/nn/THNN.lua:804: in function 'MultiMarginCriterion_updateOutput'\r\n\t.../torch/install/share/lua/5.1/nn/MultiMarginCriterion.lua:19: in function 'forward'\r\n\t4_train.lua:161: in function 'opfunc'\r\n\t/root/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'\r\n\t4_train.lua:184: in function 'train'\r\n\tdoall.lua:80: in main chunk\r\n\t[C]: in function 'f'\r\n\t[string \"local f = function() return dofile('doall.lua...\"]:1: in main chunk\r\n\t[C]: in function 'xpcall'\r\n\t/root/torch/install/share/lua/5.1/itorch/main.lua:209: in function </root/torch/install/share/lua/5.1/itorch/main.lua:173>\r\n\t/root/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex'\r\n\t/root/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start'\r\n\t/root/torch/install/share/lua/5.1/itorch/main.lua:381: in main chunk\r\n\t[C]: in function 'require'\r\n\t(command line):1: in main chunk\r\n\t[C]: at 0x00405bd0\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/torch/tutorials/issues/comments/195382717","html_url":"https://github.com/torch/tutorials/issues/43#issuecomment-195382717","issue_url":"https://api.github.com/repos/torch/tutorials/issues/43","id":195382717,"user":{"login":"danielamassiceti","id":15345596,"avatar_url":"https://avatars.githubusercontent.com/u/15345596?v=3","gravatar_id":"","url":"https://api.github.com/users/danielamassiceti","html_url":"https://github.com/danielamassiceti","followers_url":"https://api.github.com/users/danielamassiceti/followers","following_url":"https://api.github.com/users/danielamassiceti/following{/other_user}","gists_url":"https://api.github.com/users/danielamassiceti/gists{/gist_id}","starred_url":"https://api.github.com/users/danielamassiceti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielamassiceti/subscriptions","organizations_url":"https://api.github.com/users/danielamassiceti/orgs","repos_url":"https://api.github.com/users/danielamassiceti/repos","events_url":"https://api.github.com/users/danielamassiceti/events{/privacy}","received_events_url":"https://api.github.com/users/danielamassiceti/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T14:16:02Z","updated_at":"2016-03-11T14:16:02Z","body":"I have the same problem"}}