How to load a model when the layer names are not the same?

The state_dict is an instance of an OrderedDict, so you could iterate all keys and change their name as done here.

1 Like