Error

ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's...

Solution

When loading the training model, you need to pay attention to keep the network layer defined before training and after training consistent