You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It shows RuntimeError:Error(s) in loading state_dict for Net:
Missing key(s) in state_dict:"feat0.conv.bias","feat0.conv.weight","feat0.conv.act.weight"...........
Unexcepted key(s) in state_dict:"moudle.feat0.conv.weight","moudle.feat0.conv.bias"........
Can you give me some advices?Thank you very much.
The text was updated successfully, but these errors were encountered:
I'm probably a little late to the party, but let me answer this for the future wanderers. When you modify the network by adding/removing a layer or doing anything that modifies the architecture of the network, you are inherently changing the whole model itself.
Simply put, you made a new network. The state dict you're using is for the original model, and hence does not include the parameter entries for your layers. If you wish to test your modified network you will have to train it from scratch (which I wont suggest) or you can use transfer learning (which might save you a lot of time by converging to a lower loss quicker).
You may have to write your own script that initializes the weights of the original layers from the original state dict while using some other parameters initialization method (Glorot, He, Xavier initialization are some of them. Also see this) for the newer layers that you added.
It shows RuntimeError:Error(s) in loading state_dict for Net:
Missing key(s) in state_dict:"feat0.conv.bias","feat0.conv.weight","feat0.conv.act.weight"...........
Unexcepted key(s) in state_dict:"moudle.feat0.conv.weight","moudle.feat0.conv.bias"........
Can you give me some advices?Thank you very much.
The text was updated successfully, but these errors were encountered: