This small code snippet seems to work, so could you share a minimal code example to reproduce this issue?
# create a simple model using a linear layer
class MyModel(nn.Module):
def __init__(self):
super(MyModel, self).__init__()
self.params = nn.ParameterList([
nn.Parameter(torch.randn(1)),
nn.Parameter(torch.randn(1)),
nn.Parameter(torch.randn(1))
])
self.fc1 = nn.Linear(1, 1)
def forward(self, x):
x =self.fc1(x)
return x
model = MyModel()
print(model.state_dict())
sd = model.state_dict()
model = MyModel()
model.load_state_dict(sd)
print(model.state_dict())