My saved state_dict does not contain all the layers that are in my model. How can I ignore the Missing key(s) in state_dict error and initialize the remaining weights?
Then you can iterate
for n, p in model.named_parameters() and do whatever you want for
n not in sd or so.
It’s exactly what I was looking for, thank you so much!