{"action":"created","issue":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/10424","repository_url":"https://api.github.com/repos/pytorch/pytorch","labels_url":"https://api.github.com/repos/pytorch/pytorch/issues/10424/labels{/name}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/10424/comments","events_url":"https://api.github.com/repos/pytorch/pytorch/issues/10424/events","html_url":"https://github.com/pytorch/pytorch/issues/10424","id":349681010,"node_id":"MDU6SXNzdWUzNDk2ODEwMTA=","number":10424,"title":"RuntimeError \"sizes must be non-negative\" (0.4.1)","user":{"login":"evanfeinberg","id":1760982,"node_id":"MDQ6VXNlcjE3NjA5ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/1760982?v=4","gravatar_id":"","url":"https://api.github.com/users/evanfeinberg","html_url":"https://github.com/evanfeinberg","followers_url":"https://api.github.com/users/evanfeinberg/followers","following_url":"https://api.github.com/users/evanfeinberg/following{/other_user}","gists_url":"https://api.github.com/users/evanfeinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/evanfeinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanfeinberg/subscriptions","organizations_url":"https://api.github.com/users/evanfeinberg/orgs","repos_url":"https://api.github.com/users/evanfeinberg/repos","events_url":"https://api.github.com/users/evanfeinberg/events{/privacy}","received_events_url":"https://api.github.com/users/evanfeinberg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-10T23:05:00Z","updated_at":"2018-08-14T12:51:05Z","closed_at":"2018-08-11T21:06:36Z","author_association":"NONE","body":"In the transition from PyTorch 0.3.1 --> 0.4.1, we noticed the following error. When initializing a tensor beginning with a dimension of size -1 (to account for inconsistent batch sizes), the following error is thrown:\r\n\r\n`RuntimeError: sizes must be non-negative`\r\n\r\nSimple reproducing example...\r\n`x = torch.FloatTensor(-1,2)`\r\n`x_batch = torch.FloatTensor([[0., 1.], [2., 3.]])`\r\n`x.resize_as_(x_batch).copy_(x_batch)`\r\n`x_var = Variable(x)`\r\n\r\n(even just the first line will reproduce it)\r\n\r\nThis was not the case in PyTorch <= 0.3.1. \r\n\r\nWe successfully resolved the issue by simply replacing \"-1\" with \"0\", though thought we should report this in case the change should be made clearer in documentation or if other PyTorch users upgrade to 0.4, run into this error, and are seeking a solution.\r\n\r\nRegardless of this relatively minor issue, thanks for all your incredible work on PyTorch and for the community for being so active and responsive around it. "},"comment":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/comments/412860531","html_url":"https://github.com/pytorch/pytorch/issues/10424#issuecomment-412860531","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/10424","id":412860531,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjg2MDUzMQ==","user":{"login":"george-studenko","id":17111931,"node_id":"MDQ6VXNlcjE3MTExOTMx","avatar_url":"https://avatars2.githubusercontent.com/u/17111931?v=4","gravatar_id":"","url":"https://api.github.com/users/george-studenko","html_url":"https://github.com/george-studenko","followers_url":"https://api.github.com/users/george-studenko/followers","following_url":"https://api.github.com/users/george-studenko/following{/other_user}","gists_url":"https://api.github.com/users/george-studenko/gists{/gist_id}","starred_url":"https://api.github.com/users/george-studenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/george-studenko/subscriptions","organizations_url":"https://api.github.com/users/george-studenko/orgs","repos_url":"https://api.github.com/users/george-studenko/repos","events_url":"https://api.github.com/users/george-studenko/events{/privacy}","received_events_url":"https://api.github.com/users/george-studenko/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T12:51:05Z","updated_at":"2018-08-14T12:51:05Z","author_association":"NONE","body":"Thanks @fmassa you are right!, \r\n\r\nI had images at 224,  changing it to 299 did the trick, had to fix another known issue (aux_logits=False) and now it is training!"}}
{"actor":{"display_login":"george-studenko"}}