RuntimeError: size mismatch

Hello, what could be causing this this error?, its happening to me on every dataset am getting confused, please help!


RuntimeError Traceback (most recent call last)
in
----> 1 history = [evaluate(model, val_loader)]
2 history

in evaluate(model, val_loader)
1 def evaluate(model, val_loader):
----> 2 outputs = [model.validation_step(batch) for batch in val_loader]
3 return model.validation_epoch_end(outputs)
4
5 def fit(epochs, lr, model, train_loader, val_loader, opt_func=torch.optim.SGD):

in (.0)
1 def evaluate(model, val_loader):
----> 2 outputs = [model.validation_step(batch) for batch in val_loader]
3 return model.validation_epoch_end(outputs)
4
5 def fit(epochs, lr, model, train_loader, val_loader, opt_func=torch.optim.SGD):

in validation_step(self, batch)
8 def validation_step(self, batch):
9 images, labels = batch
—> 10 out = self(images) # Generate predictions
11 loss = F.cross_entropy(out, labels) # Calculate loss
12 acc = accuracy(out, labels) # Calculate accuracy

/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
548 result = self._slow_forward(*input, **kwargs)
549 else:
–> 550 result = self.forward(*input, **kwargs)
551 for hook in self._forward_hooks.values():
552 hook_result = hook(self, input, result)

in forward(self, xb)
14 # Apply layers & activation functions
15 # Input layer
—> 16 out = self.in_layer(out)
17 # Hidden layers w/ ReLU
18 out = self.hidden1(F.relu(out))

/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
548 result = self._slow_forward(*input, **kwargs)
549 else:
–> 550 result = self.forward(*input, **kwargs)
551 for hook in self._forward_hooks.values():
552 hook_result = hook(self, input, result)

/opt/conda/lib/python3.7/site-packages/torch/nn/modules/linear.py in forward(self, input)
85
86 def forward(self, input):
—> 87 return F.linear(input, self.weight, self.bias)
88
89 def extra_repr(self):

/opt/conda/lib/python3.7/site-packages/torch/nn/functional.py in linear(input, weight, bias)
1608 if input.dim() == 2 and bias is not None:
1609 # fused op is marginally faster
-> 1610 ret = torch.addmm(bias, input, weight.t())
1611 else:
1612 output = input.matmul(weight.t())

RuntimeError: size mismatch, m1: [80 x 270000], m2: [30000 x 8384] at /opt/conda/conda-bld/pytorch_1591914880026/work/aten/src/THC/generic/THCTensorMathBlas.cu:283