In my case it didn’t worked. I still get the same error. Maybe the mistake that I’m commiting isn’t there? Here is the new error trace:
Size of self.fc in the init function: Linear(in_features=8192, out_features=2341, bias=True)
The shape of the tensor passed to the model is: torch.Size([2, 3, 448, 448])
The shape of x in the forward function is: torch.Size([2, 2048])
Traceback (most recent call last):
  File "test.py", line 58, in <module>
    _, concat_logits, _, _, _ = net(img)
  File "/home/julio/anaconda3/envs/logo2k/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/julio/anaconda3/envs/logo2k/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 153, in forward
    return self.module(*inputs[0], **kwargs[0])
  File "/home/julio/anaconda3/envs/logo2k/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/julio/wdir/code/Logo-2k-plus-Dataset/Drna-master/core/model_resnet.py", line 85, in forward
    resnet_out, rpn_feature, feature = self.pretrained_model(x)
  File "/home/julio/anaconda3/envs/logo2k/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/julio/wdir/code/Logo-2k-plus-Dataset/Drna-master/core/resnet.py", line 156, in forward
    x = self.fc(x)
  File "/home/julio/anaconda3/envs/logo2k/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/julio/anaconda3/envs/logo2k/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 91, in forward
    return F.linear(input, self.weight, self.bias)
  File "/home/julio/anaconda3/envs/logo2k/lib/python3.7/site-packages/torch/nn/functional.py", line 1674, in linear
    ret = torch.addmm(bias, input, weight.t())
RuntimeError: mat1 dim 1 must match mat2 dim 0