Optimizer problem when copying a model

Hello, I have to train n clients where each client has its own model

so I instantiated a model model=Net() and then created n copies:


after every batch I aggregate all weights and do the following:

I noticed that there is no learning, and the loss gets stuck.

Any suggestion for this problem?

Why do you have multiple models and then average their weights?

Each model might learn something different, and taking the average of the weights, especially during training, won’t result in a better estimation to solve the problem at hand.