{"action":"created","issue":{"url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark/issues/31","repository_url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark","labels_url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark/issues/31/comments","events_url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark/issues/31/events","html_url":"https://github.com/facebookresearch/maskrcnn-benchmark/issues/31","id":374292579,"node_id":"MDU6SXNzdWUzNzQyOTI1Nzk=","number":31,"title":"RuntimeError: The shape of the mask [230202] at index 0 does not match the shape of the indexed tensor [0] at index 0","user":{"login":"liminghao1630","id":23090329,"node_id":"MDQ6VXNlcjIzMDkwMzI5","avatar_url":"https://avatars2.githubusercontent.com/u/23090329?v=4","gravatar_id":"","url":"https://api.github.com/users/liminghao1630","html_url":"https://github.com/liminghao1630","followers_url":"https://api.github.com/users/liminghao1630/followers","following_url":"https://api.github.com/users/liminghao1630/following{/other_user}","gists_url":"https://api.github.com/users/liminghao1630/gists{/gist_id}","starred_url":"https://api.github.com/users/liminghao1630/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liminghao1630/subscriptions","organizations_url":"https://api.github.com/users/liminghao1630/orgs","repos_url":"https://api.github.com/users/liminghao1630/repos","events_url":"https://api.github.com/users/liminghao1630/events{/privacy}","received_events_url":"https://api.github.com/users/liminghao1630/received_events","type":"User","site_admin":false},"labels":[{"id":1103546452,"node_id":"MDU6TGFiZWwxMTAzNTQ2NDUy","url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark/labels/awaiting%20response","name":"awaiting response","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-10-26T09:07:50Z","updated_at":"2018-10-30T07:49:58Z","closed_at":null,"author_association":"NONE","body":"## ❓ Questions and Help\r\nTraceback (most recent call last):\r\n  File \"github/maskrcnn-benchmark/tools/train_net.py\", line 170, in <module>\r\n    main()\r\n  File \"github/maskrcnn-benchmark/tools/train_net.py\", line 163, in main\r\n    model = train(cfg, args.local_rank, args.distributed)\r\n  File \"github/maskrcnn-benchmark/tools/train_net.py\", line 73, in train\r\n    arguments,\r\n  File \"/home/v-minghl/github/maskrcnn-benchmark/maskrcnn_benchmark/engine/trainer.py\", line 65, in do_train\r\n    loss_dict = model(images, targets)\r\n  File \"/home/v-minghl/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py\", line 477, in __call__\r\n    result = self.forward(*input, **kwargs)\r\n  File \"/home/v-minghl/github/maskrcnn-benchmark/maskrcnn_benchmark/modeling/detector/generalized_rcnn.py\", line 50, in forward\r\n    proposals, proposal_losses = self.rpn(images, features, targets)\r\n  File \"/home/v-minghl/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py\", line 477, in __call__\r\n    result = self.forward(*input, **kwargs)\r\n  File \"/home/v-minghl/github/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/rpn.py\", line 94, in forward\r\n    return self._forward_train(anchors, objectness, rpn_box_regression, targets)\r\n  File \"/home/v-minghl/github/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/rpn.py\", line 113, in _forward_train\r\n    anchors, objectness, rpn_box_regression, targets\r\n  File \"/home/v-minghl/github/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/loss.py\", line 91, in __call__\r\n    labels, regression_targets = self.prepare_targets(anchors, targets)\r\n  File \"/home/v-minghl/github/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/loss.py\", line 62, in prepare_targets\r\n    labels_per_image[~anchors_per_image.get_field(\"visibility\")] = -1\r\nRuntimeError: The shape of the mask [230202] at index 0 does not match the shape of the indexed tensor [0] at index 0\r\n\r\nHi,\r\nI used my own data set in coco format to train.   batchsize 2 and max iter is 15000.   Train on P100 * 1.\r\nIt can succeed to run for 2540 iters and crashed with this error.\r\nI succeed to train this data set with mmdetection. \r\nI have no idea why the error happened, please give me some help.\r\n"},"comment":{"url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark/issues/comments/434203095","html_url":"https://github.com/facebookresearch/maskrcnn-benchmark/issues/31#issuecomment-434203095","issue_url":"https://api.github.com/repos/facebookresearch/maskrcnn-benchmark/issues/31","id":434203095,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDIwMzA5NQ==","user":{"login":"fmassa","id":9110200,"node_id":"MDQ6VXNlcjkxMTAyMDA=","avatar_url":"https://avatars2.githubusercontent.com/u/9110200?v=4","gravatar_id":"","url":"https://api.github.com/users/fmassa","html_url":"https://github.com/fmassa","followers_url":"https://api.github.com/users/fmassa/followers","following_url":"https://api.github.com/users/fmassa/following{/other_user}","gists_url":"https://api.github.com/users/fmassa/gists{/gist_id}","starred_url":"https://api.github.com/users/fmassa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmassa/subscriptions","organizations_url":"https://api.github.com/users/fmassa/orgs","repos_url":"https://api.github.com/users/fmassa/repos","events_url":"https://api.github.com/users/fmassa/events{/privacy}","received_events_url":"https://api.github.com/users/fmassa/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T07:49:58Z","updated_at":"2018-10-30T07:49:58Z","author_association":"CONTRIBUTOR","body":"@zylhub thanks for the snippet!\r\nMy original idea was to make the dataset remove the empty boxes when in training mode, but it seems that my solution is not adapted to all cases.\r\nJust to know, did you write your own dataset class, or are you using the COCODataset, and feeding your data in COCO format?"}}
{"actor":{"display_login":"fmassa"}}