2 years ago
#73080

Quang Đại Nguyễn
how does (PyTorch) model.load_state_dict() work for modified model?
I've modified BasicBlock of Resnet architecture by adding a few more FC layers at the end of the block. I tried model.load_state_dict() on the new model and it worked perfectly. I wonder how the weights of these layers are treated when I load pretrained weights. Are pretrained weights assigned properly to correct layers and weights from new layers are intialized randomly? Or model.load_state_dict() fail in this scenario and all weights of the model are intialized from the beginning?
pytorch
computer-vision
conv-neural-network
resnet
0 Answers
Your Answer