How to load net structure of the model and its parameters from the pretrained *.pth with Pytrch?

I think you can ignore the warning.

The model was probably saved in a previous version of pytorch and there has probably been of a slight change in behaviour in some part of pytorch.

The warning occurs for res2a_branch2a.weight, which is of shape (64, 64, 1, 1), but got saved shape (64, 64). It looks to me like they are compatible and that a pointwise copy would work equivalently to the suggested fix.

I wondered why only one instance of a Conv2d caused such a warning when the model contains many, and interestingly enough, there is only one Conv2d in the entire model with in_channels==out_channels and kernel_size=[1, 1] and stride=(1, 1). Maybe the shape of the weight array in this specific case has been changed in a recent update to pytorch.