Thank you for your reply.
The error persists in the same way. Changing the key names results in matching the keys and loading the model properly.
image987×332 33.9 KB
As i had mentioned,



 Praveen_K:

I think the problem comes when i copy the weights of encoder. Here the key name is changed when I copy to train classifier network


While copying the encoder for further training as classifier, I’m not copying the key names and this is resulting in error. The name before copying was encoder after it will be 0. Hence 0.0.weight, 0.0.bias
P.S : Sorry for pasting an image instead of pasting the code