I am not sure why it didn’t work for you.
But the below code works.
import torch
import torch.nn as nn

class model(nn.Module):
    def __init__(self):
        super().__init__()
        self.m1 = nn.Linear(5,6)
        self.m2 = nn.Linear(6,7)

    def create_dynamic_linear(self):
        self.m3 = nn.Linear(3,3)

    def forward(self,):
        pass

if __name__ == '__main__':
    model1 = model()
    model1.create_dynamic_linear()
    torch.save(model1.state_dict(), 'model.pth')

    model2 = model()
    miss, unexp = model2.load_state_dict(torch.load('model.pth'), strict=False)

    print(miss, unexp)