Federated-Learning-PyTorch icon indicating copy to clipboard operation
Federated-Learning-PyTorch copied to clipboard

copy.deepcopy(model), why?

Open Turningl opened this issue 2 years ago • 1 comments

Hello, your project has helped me a lot. Thank you very much. But I have a question: why do I need copy.deepcopy(model) when I am trying to implement a federated learning model, it seems that without copy.deepcopy all models will have the same weight. It's only when you use it that the model is different. So why is that?

Turningl avatar Mar 25 '23 12:03 Turningl

Hi, Can you provide the filename together with the corresponding line number? y = copy.deepcopy(x) returns y which is a copy of variable x. Any future operations on x will not affect y.

saigontrade88 avatar Oct 30 '23 16:10 saigontrade88