I am getting a error in insurance problem

AttributeError Traceback (most recent call last)
in
----> 1 result = evaluate(model,val_loader) # Use the the evaluate function
2 print(result)

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)
19 inputs, targets = batch
20 # Generate predictions
—> 21 out = self(inputs)
22 # Calculate loss
23 loss = F.mse_loss(out,targets) # fill this

~\AppData\Local\Continuum\anaconda3\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
→ 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)

in forward(self, xb)
5
6 def forward(self, xb):
----> 7 out = self.linear(input_size) # fill this
8 return out
9

~\AppData\Local\Continuum\anaconda3\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
530 result = self._slow_forward(*input, **kwargs)
531 else:
→ 532 result = self.forward(*input, **kwargs)
533 for hook in self._forward_hooks.values():
534 hook_result = hook(self, input, result)

~\AppData\Local\Continuum\anaconda3\lib\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):

~\AppData\Local\Continuum\anaconda3\lib\site-packages\torch\nn\functional.py in linear(input, weight, bias)
1366 - Output: :math:(N, *, out\_features)
1367 “”"
→ 1368 if input.dim() == 2 and bias is not None:
1369 # fused op is marginally faster
1370 ret = torch.addmm(bias, input, weight.t())

AttributeError: ‘int’ object has no attribute ‘dim’

I think I am making error here

class InsuranceModel(nn.Module):
def init(self):
super().init()
self.linear = nn.Linear(input_size,output_size) # fill this (hint: use input_size & output_size defined above)

def forward(self, xb):
    out = self.linear(input_size)                       # fill this
    return out

def training_step(self, batch):
    inputs, targets = batch 
    # Generate predictions
    out = self(inputs)          
    # Calcuate loss
    loss = F.mse_loss(out,targets)                        # fill this
    return loss

How does your batch look like?

It’s solved. Thank you