ssd.pytorch icon indicating copy to clipboard operation
ssd.pytorch copied to clipboard

Why the shape does not match

Open chrisyxue opened this issue 5 years ago • 3 comments

Traceback (most recent call last): File "train.py", line 255, in train() File "train.py", line 178, in train loss_l, loss_c = criterion(out, targets) File "/data6/home/xuezhiyu/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, **kwargs) File "/data6/home/xuezhiyu/TeamWork/ssd.pytorch-master/layers/modules/multibox_loss.py", line 97, in forward loss_c[pos] = 0 # filter out pos boxes for now IndexError: The shape of the mask [32, 8732] at index 0 does not match the shape of the indexed tensor [279424, 1] at index 0

chrisyxue avatar Sep 06 '19 05:09 chrisyxue

issue里有过这个问题,我当时好像也遇到过,你看看issue

---Original--- From: "ChrisXue"<[email protected]> Date: Fri, Sep 6, 2019 13:19 PM To: "amdegroot/ssd.pytorch"<[email protected]>; Cc: "Subscribed"<[email protected]>; Subject: [amdegroot/ssd.pytorch] Why the shape does not match (#401)

Traceback (most recent call last): File "train.py", line 255, in train() File "train.py", line 178, in train loss_l, loss_c = criterion(out, targets) File "/data6/home/xuezhiyu/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, **kwargs) File "/data6/home/xuezhiyu/TeamWork/ssd.pytorch-master/layers/modules/multibox_loss.py", line 97, in forward loss_c[pos] = 0 # filter out pos boxes for now IndexError: The shape of the mask [32, 8732] at index 0 does not match the shape of the indexed tensor [279424, 1] at index 0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

yyx1107 avatar Sep 06 '19 05:09 yyx1107

Has this been resolved? I have the same problem..Can you help ? thank you!

uzair789 avatar Feb 08 '22 01:02 uzair789

Resolved here-- some error in code #518

uzair789 avatar Feb 08 '22 01:02 uzair789