lzx1413 / PytorchSSD

pytorch version of SSD and it's enhanced methods such as RFBSSD,FSSD and RefineDet
MIT License
709 stars 237 forks source link

A problem about branch 0.4 #78

Closed SingL3 closed 1 year ago

SingL3 commented 5 years ago

Hello, I am trying to run SSD_vgg in branch 0.4.

python train_test.py -d VOC -v SSD_vgg -s 512 -b 16

And I got the below error:

Traceback (most recent call last): File "train_test.py", line 425, in train() File "train_test.py", line 290, in train loss_l, loss_c = criterion(out, priors, targets) File "/home/lin/anaconda3/envs/panet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, **kwargs) File "/mnt/disk2/lin/ssd_pytorch_trial/PytorchSSD/layers/modules/multibox_loss.py", line 79, in forward pos_idx = pos.unsqueeze(pos.dim()).expand_as(loc_data) File "/home/lin/anaconda3/envs/panet/lib/python3.6/site-packages/torch/tensor.py", line 302, in expand_as return self.expand(tensor.size()) RuntimeError: The expanded size of the tensor (32752) must match the existing size (32756) at non-singleton dimension 1

I check the config. There should be 7 pyramid feature but len(pyramid_fea) is 6. Is it a bug or I make some mistake?

cxf2015 commented 5 years ago

recheck config.py

sagittahjz commented 5 years ago

@SingL3 You should attach [128, 'S', 256] to the end of extras['512'] in SSD_vgg.py