{"action":"created","issue":{"url":"https://api.github.com/repos/Cysu/open-reid/issues/69","repository_url":"https://api.github.com/repos/Cysu/open-reid","labels_url":"https://api.github.com/repos/Cysu/open-reid/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/Cysu/open-reid/issues/69/comments","events_url":"https://api.github.com/repos/Cysu/open-reid/issues/69/events","html_url":"https://github.com/Cysu/open-reid/issues/69","id":321218339,"node_id":"MDU6SXNzdWUzMjEyMTgzMzk=","number":69,"title":"Zero-dimensional tensor concatenation problem","user":{"login":"CaesarPan","id":10978608,"node_id":"MDQ6VXNlcjEwOTc4NjA4","avatar_url":"https://avatars2.githubusercontent.com/u/10978608?v=4","gravatar_id":"","url":"https://api.github.com/users/CaesarPan","html_url":"https://github.com/CaesarPan","followers_url":"https://api.github.com/users/CaesarPan/followers","following_url":"https://api.github.com/users/CaesarPan/following{/other_user}","gists_url":"https://api.github.com/users/CaesarPan/gists{/gist_id}","starred_url":"https://api.github.com/users/CaesarPan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaesarPan/subscriptions","organizations_url":"https://api.github.com/users/CaesarPan/orgs","repos_url":"https://api.github.com/users/CaesarPan/repos","events_url":"https://api.github.com/users/CaesarPan/events{/privacy}","received_events_url":"https://api.github.com/users/CaesarPan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-08T14:47:00Z","updated_at":"2018-08-08T15:53:07Z","closed_at":null,"author_association":"NONE","body":"Hi there,\r\n\r\nThank you for the code!\r\n\r\nWhile training the ResNet50 model using the market1501 dataset, I got the following Runtime error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"examples/triplet_loss.py\", line 232, in <module>\r\n    main(parser.parse_args())\r\n  File \"examples/triplet_loss.py\", line 151, in main\r\n    trainer.train(epoch, train_loader, optimizer)\r\n  File \"/home/bxpan/.local/lib/python3.5/site-packages/open_reid-0.2.0-py3.5.egg/reid/trainers.py\", line 33, in train\r\n  File \"/home/bxpan/.local/lib/python3.5/site-packages/open_reid-0.2.0-py3.5.egg/reid/trainers.py\", line 83, in _forward\r\n  File \"/home/bxpan/.local/lib/python3.5/site-packages/torch/nn/modules/module.py\", line 491, in __call__\r\n    result = self.forward(*input, **kwargs)\r\n  File \"/home/bxpan/.local/lib/python3.5/site-packages/open_reid-0.2.0-py3.5.egg/reid/loss/triplet.py\", line 26, in forward\r\nRuntimeError: zero-dimensional tensor (at position 0) cannot be concatenated\r\n```\r\n\r\nThe problem turned out to happen at this specific line of code in `triplet.py`:\r\n`dist_ap = torch.cat(dist_ap)`\r\nI have printed out `dist_ap`, which is a python list full of zero-dimensional (its printed-out size is: `torch.Size([])`) tensors (I used a batch-size of 64 so the list has a length of 64):\r\n\r\n`[tensor(0.2895, device='cuda:0'), tensor(0.3334, device='cuda:0'), tensor(0.3334, device='cuda:0'), tensor(0.3175, device='cuda:0'), tensor(0.3078, device='cuda:0'), tensor(0.3078, device='cuda:0'), tensor(0.3045, device='cuda:0'), tensor(0.3045, device='cuda:0'), tensor(0.2636, device='cuda:0'), tensor(0.2630, device='cuda:0'), tensor(0.2497, device='cuda:0'), tensor(0.2636, device='cuda:0'), tensor(0.2967, device='cuda:0'), tensor(0.2657, device='cuda:0'), tensor(0.2967, device='cuda:0'), tensor(0.2936, device='cuda:0'), tensor(0.3517, device='cuda:0'), tensor(0.2939, device='cuda:0'), tensor(0.3517, device='cuda:0'), tensor(0.3185, device='cuda:0'), tensor(0.3318, device='cuda:0'), tensor(0.3357, device='cuda:0'), tensor(0.3260, device='cuda:0'), tensor(0.3357, device='cuda:0'), tensor(0.2928, device='cuda:0'), tensor(0.2906, device='cuda:0'), tensor(0.2928, device='cuda:0'), tensor(0.2906, device='cuda:0'), tensor(0.1992, device='cuda:0'), tensor(0.2086, device='cuda:0'), tensor(0.2086, device='cuda:0'), tensor(0.2040, device='cuda:0'), tensor(0.2742, device='cuda:0'), tensor(0.2836, device='cuda:0'), tensor(0.3117, device='cuda:0'), tensor(0.3117, device='cuda:0'), tensor(0.2838, device='cuda:0'), tensor(0.2686, device='cuda:0'), tensor(0.2435, device='cuda:0'), tensor(0.2838, device='cuda:0'), tensor(0.3124, device='cuda:0'), tensor(0.3268, device='cuda:0'), tensor(0.3304, device='cuda:0'), tensor(0.3304, device='cuda:0'), tensor(0.2591, device='cuda:0'), tensor(0.2671, device='cuda:0'), tensor(0.2825, device='cuda:0'), tensor(0.2825, device='cuda:0'), tensor(0.3309, device='cuda:0'), tensor(0.2836, device='cuda:0'), tensor(0.3126, device='cuda:0'), tensor(0.3309, device='cuda:0'), tensor(0.3232, device='cuda:0'), tensor(0.3493, device='cuda:0'), tensor(0.3493, device='cuda:0'), tensor(0.3379, device='cuda:0'), tensor(0.3044, device='cuda:0'), tensor(0.3173, device='cuda:0'), tensor(0.3173, device='cuda:0'), tensor(0.3009, device='cuda:0'), tensor(0.2941, device='cuda:0'), tensor(0.3048, device='cuda:0'), tensor(0.3048, device='cuda:0'), tensor(0.2704, device='cuda:0')]`\r\n\r\nThe values of the tensors seem to be of no problem, but the concatenation fails. Any idea about what the problem is?\r\n\r\nThank you very much.\r\n\r\nBoxiao\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Cysu/open-reid/issues/comments/411456415","html_url":"https://github.com/Cysu/open-reid/issues/69#issuecomment-411456415","issue_url":"https://api.github.com/repos/Cysu/open-reid/issues/69","id":411456415,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTQ1NjQxNQ==","user":{"login":"dem123456789","id":6510674,"node_id":"MDQ6VXNlcjY1MTA2NzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6510674?v=4","gravatar_id":"","url":"https://api.github.com/users/dem123456789","html_url":"https://github.com/dem123456789","followers_url":"https://api.github.com/users/dem123456789/followers","following_url":"https://api.github.com/users/dem123456789/following{/other_user}","gists_url":"https://api.github.com/users/dem123456789/gists{/gist_id}","starred_url":"https://api.github.com/users/dem123456789/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dem123456789/subscriptions","organizations_url":"https://api.github.com/users/dem123456789/orgs","repos_url":"https://api.github.com/users/dem123456789/repos","events_url":"https://api.github.com/users/dem123456789/events{/privacy}","received_events_url":"https://api.github.com/users/dem123456789/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T15:53:07Z","updated_at":"2018-08-08T15:53:07Z","author_association":"NONE","body":"Actually, this issue is fixed for mr at 0.4.1"}}
{"actor":{"display_login":"dem123456789"}}