본문 바로가기

Deep Learning

[Pytorch] Assign (loaded) pre-trained model params to a specific layer of a new model

반응형
self.model.Traj_Dec.decoder_mlp[0].weight.data = checkpoint['scratch_state_dict']['Traj_Dec.decoder_mlp.0.weight']
self.model.Traj_Dec.decoder_mlp[0].bias.data = checkpoint['scratch_state_dict']['Traj_Dec.decoder_mlp.0.bias']