pretrained-models.pytorch
pretrained-models.pytorch copied to clipboard
problem:RuntimeError: 1only batches of spatial targets supported (non-empty 3D tensors) but got targets of size: : [20]
(1)when i run the architecture squeezenet1_0 and squeezenet1_1 ,I met the problem above. (2)then I print the shape of output and target as below: output.shape torch.Size([20, 1000, 1, 1]) target.shape torch.Size([20]) obviously, it' s the reason that the shape is not matched. (3)so i add the code: output = model(input) output =output.reshape(-1,1000) and it worked (4)but there maybe remains some better solution,such as modify the code of squeezenet1_0 and squeezenet1_1(ps: because other architetures don't have the problems above)
I had the same problem:Runtimeerror:lonely batches of spatial targets supported (non-empty 3D tensors)but got targets of size[2,513,513,3],How did you modify it
same problem, but obviously the issue should be on PyTorch, not this repo.