In general, when loading a pretrained model, the library expects tensor shapes to match those of the pretrained model you want to load. This is why you are getting your error, and I don’t think there is a quick fix to this.
I think you need to manually write some loading method in this case, to load everything but the last layer.