Advertisement
Illuvitar

RuntimeError: size mismatch, m1: [64 x 8192], m2: [2048 x 76

Dec 19th, 2018
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. ---------------------------------------------------------------------------
  2. RuntimeError Traceback (most recent call last)
  3. <ipython-input-38-32e1a80e12b8> in <module>()
  4. 16 optimiser.zero_grad()
  5. 17
  6. ---> 18 logps = model(images)
  7. 19 loss = criterion(logps, labels)
  8. 20
  9.  
  10. /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
  11. 487 if isinstance(var, dict):
  12. 488 var = next((v for v in var.values() if isinstance(v, torch.Tensor)))
  13. --> 489 else:
  14. 490 var = var[0]
  15. 491 grad_fn = var.grad_fn
  16.  
  17. /usr/local/lib/python3.6/dist-packages/torchvision/models/resnet.py in forward(self, x)
  18. 149 x = self.avgpool(x)
  19. 150 x = x.view(x.size(0), -1)
  20. --> 151 x = self.fc(x)
  21. 152
  22. 153 return x
  23.  
  24. /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
  25. 487 if isinstance(var, dict):
  26. 488 var = next((v for v in var.values() if isinstance(v, torch.Tensor)))
  27. --> 489 else:
  28. 490 var = var[0]
  29. 491 grad_fn = var.grad_fn
  30.  
  31. /usr/local/lib/python3.6/dist-packages/torch/nn/modules/container.py in forward(self, input)
  32. 90 for module in self._modules.values():
  33. 91 input = module(input)
  34. ---> 92 return input
  35. 93
  36. 94
  37.  
  38. /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
  39. 487 if isinstance(var, dict):
  40. 488 var = next((v for v in var.values() if isinstance(v, torch.Tensor)))
  41. --> 489 else:
  42. 490 var = var[0]
  43. 491 grad_fn = var.grad_fn
  44.  
  45. /usr/local/lib/python3.6/dist-packages/torch/nn/modules/linear.py in forward(self, input)
  46. 65 :math:`y = x_1 A x_2 + b`
  47. 66
  48. ---> 67 Args:
  49. 68 in1_features: size of each first input sample
  50. 69 in2_features: size of each second input sample
  51.  
  52. /usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in linear(input, weight, bias)
  53. 1350
  54. 1351 # loss
  55. -> 1352
  56. 1353
  57. 1354 def nll_loss(input, target, weight=None, size_average=None, ignore_index=-100,
  58.  
  59. RuntimeError: size mismatch, m1: [64 x 8192], m2: [2048 x 768] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:266
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement