{"action":"created","issue":{"url":"https://api.github.com/repos/jzbontar/mc-cnn/issues/35","repository_url":"https://api.github.com/repos/jzbontar/mc-cnn","labels_url":"https://api.github.com/repos/jzbontar/mc-cnn/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/jzbontar/mc-cnn/issues/35/comments","events_url":"https://api.github.com/repos/jzbontar/mc-cnn/issues/35/events","html_url":"https://github.com/jzbontar/mc-cnn/issues/35","id":244571528,"number":35,"title":"Running main.lua for training gives reshape function exception","user":{"login":"rohanchabra","id":28881693,"avatar_url":"https://avatars2.githubusercontent.com/u/28881693?v=4","gravatar_id":"","url":"https://api.github.com/users/rohanchabra","html_url":"https://github.com/rohanchabra","followers_url":"https://api.github.com/users/rohanchabra/followers","following_url":"https://api.github.com/users/rohanchabra/following{/other_user}","gists_url":"https://api.github.com/users/rohanchabra/gists{/gist_id}","starred_url":"https://api.github.com/users/rohanchabra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohanchabra/subscriptions","organizations_url":"https://api.github.com/users/rohanchabra/orgs","repos_url":"https://api.github.com/users/rohanchabra/repos","events_url":"https://api.github.com/users/rohanchabra/events{/privacy}","received_events_url":"https://api.github.com/users/rohanchabra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-21T05:58:25Z","updated_at":"2017-08-25T10:31:03Z","closed_at":null,"body":"I am able to run the test set correctly. But training gives me such error. The images are in the correct folder. What might be the problem?\r\n\r\n./main.lua kitti slow -a train_trkitti \r\nslow -a train_tr \r\nluajit: ./main.lua:378: inconsistent tensor size, expected tensor [389 x 1 x 350 x 1242] and src [] to have the same number of elements, but got 169098300 and 0 elements respectively at /home/rohan140290/torch/pkg/torch/lib/TH/generic/THTensorCopy.c:86\r\nstack traceback:\r\n\t[C]: in function 'reshape'\r\n\t./main.lua:378: in function 'fromfile'\r\n\t./main.lua:428: in main chunk\r\n\t[C]: at 0x00405d50\r\n\r\n\r\nIt seems like torch is not able to parse the file correctly.\r\nx = torch.FloatTensor(torch.FloatStorage(fname)) :- Seems to have issues.\r\n\r\nI instead tried to do this:-\r\n\r\nfor i = 1,#dim do\r\n   s = s * dim[i]\r\n end\r\n\r\nx = torch.FloatTensor(torch.FloatStorage(s))\r\ntorch.DiskFile(fname,'r'):binary():readFloat(x:storage())\r\n\r\nThis  seems to work for me.\r\n"},"comment":{"url":"https://api.github.com/repos/jzbontar/mc-cnn/issues/comments/324881745","html_url":"https://github.com/jzbontar/mc-cnn/issues/35#issuecomment-324881745","issue_url":"https://api.github.com/repos/jzbontar/mc-cnn/issues/35","id":324881745,"user":{"login":"strivejin","id":31344329,"avatar_url":"https://avatars2.githubusercontent.com/u/31344329?v=4","gravatar_id":"","url":"https://api.github.com/users/strivejin","html_url":"https://github.com/strivejin","followers_url":"https://api.github.com/users/strivejin/followers","following_url":"https://api.github.com/users/strivejin/following{/other_user}","gists_url":"https://api.github.com/users/strivejin/gists{/gist_id}","starred_url":"https://api.github.com/users/strivejin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strivejin/subscriptions","organizations_url":"https://api.github.com/users/strivejin/orgs","repos_url":"https://api.github.com/users/strivejin/repos","events_url":"https://api.github.com/users/strivejin/events{/privacy}","received_events_url":"https://api.github.com/users/strivejin/received_events","type":"User","site_admin":false},"created_at":"2017-08-25T10:31:03Z","updated_at":"2017-08-25T10:31:03Z","body":"I change the code just like you do :\r\n\"I instead tried to do this:-\r\n\r\nfor i = 1,#dim do\r\ns = s * dim[i]\r\nend\r\n\r\nx = torch.FloatTensor(torch.FloatStorage(s))\r\ntorch.DiskFile(fname,'r'):binary():readFloat(x:storage())\"\r\nbut it still don't work ,do you know why?\r\n\r\nkitti slow -a train_tr \r\nluajit: ./main.lua:369: attempt to perform arithmetic on global 's' (a nil value)\r\nstack traceback:\r\n\t./main.lua:369: in function 'fromfile'\r\n\t./main.lua:434: in main chunk\r\n\t[C]: at 0x00405d50\r\n\r\n"}}
{"actor":{"display_login":"strivejin"}}