You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def forward(self, x):
out = self.conv(x)
out = self.bn(out)
out = self.relu(out)
out = self.layer1(out)
out = self.layer2(out)
out = self.layer3(out)
out = self.avg_pool(out)
out = out.view(out.size(0), -1)
out = self.fc(out) # <-------------------error
return out
Traceback (most recent call last):
File "F:\soft_xj\python\lib\site-packages\torchsummary\torchsummary.py", line 140, in summary
_ = model.to(device)(*x, *args, **kwargs) # type: ignore[misc]
File "F:\soft_xj\python\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
result = self.forward(*input, **kwargs)
File "C:\Users\xj\Desktop\AI_teach2\ResNet50\model.py", line 69, in forward
out = self.fc(out)
File "F:\soft_xj\python\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
result = self.forward(*input, **kwargs)
File "F:\soft_xj\python\lib\site-packages\torch\nn\modules\linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)
File "F:\soft_xj\python\lib\site-packages\torch\nn\functional.py", line 1610, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: size mismatch, m1: [2 x 256], m2: [64 x 7] at C:/w/b/windows/pytorch/aten/src\THC/generic/THCTensorMathBlas.cu:283
summary resnet
I can print the model
The text was updated successfully, but these errors were encountered: