I am trying to deep copy models
Are there any recommended methods to clone a model? 34 and Copying weights from one net to another 40
recommends to use copy.deepcopy() which works, but shouldn’t I need to deep copy optimizer as well?
I am confused between following tow -
model2 = copy.deepcopy(model1)
opt2 = torch.optim.Adam(model2.parameters(), lr = 0.0001)

vs
model2 = copy.deepcopy(model1)
opt2 = copy.deepcopy(opt1)   # we are deepcopying model1 so, deep copy it's optimizer

Which approach is better? or incorrect?
Thanks.