talebolano / yolov3-network-slimming

yolov3 network slimming剪枝的一种实现
344 stars 93 forks source link

稀疏训练 tensor not match #44

Open zyaping opened 5 years ago

zyaping commented 5 years ago

File "sparsity_train.py", line 159, in load network done! load weightsfile done! train() File "sparsity_train.py", line 105, in train loss = model(imgs, targets) File "/home/soc/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, kwargs) File "/home/soc/PROJECT/zyp/Slim/1-2-yolov3-network-slimming-master/yolomodel.py", line 352, in forward x, losses = self.module_list[i][0](x, targets) File "/home/soc/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(input, kwargs) File "/home/soc/PROJECT/zyp/Slim/1-2-yolov3-network-slimming-master/yolomodel.py", line 130, in forward loss_y = self.mse_loss(y[mask], ty[mask]) File "/home/soc/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, **kwargs) File "/home/soc/.local/lib/python3.6/site-packages/torch/nn/modules/loss.py", line 431, in forward return F.mse_loss(input, target, reduction=self.reduction) File "/home/soc/.local/lib/python3.6/site-packages/torch/nn/functional.py", line 2203, in mse_loss expanded_input, expanded_target = torch.broadcast_tensors(input, target) File "/home/soc/.local/lib/python3.6/site-packages/torch/functional.py", line 52, in broadcast_tensors return torch._C._VariableFunctions.broadcast_tensors(tensors) RuntimeError: The size of tensor a (5) must match the size of tensor b (3) at non-singleton dimension 0