Something very odd had happened After I switched from the semi-original code to  the original code. They’re pretty much the same with small changes and organized differently. I made relevant adjustments, but everything that relates to loading the file is the same (I even copied the MDNet class).
I get a very odd error message:
RuntimeError: Error(s) in loading state_dict for Sequential:
Missing key(s) in state_dict: “fc4.1.weight”, “fc4.1.bias”.
Unexpected key(s) in state_dict: “fc4.0.weight”, “fc4.0.bias”.
The network is ok, looks like this:
Module Layer conv1.0.weight
Module Layer conv1.0.bias
Module Layer conv2.0.weight
Module Layer conv2.0.bias
Module Layer conv3.0.weight
Module Layer conv3.0.bias
Module Layer fc4.1.weight
Module Layer fc4.1.bias
Module Layer fc5.1.weight
Module Layer fc5.1.bias
But oddly, d looks like this:
([‘conv1.0.weight’, ‘conv1.0.bias’, ‘conv2.0.weight’, ‘conv2.0.bias’, ‘conv3.0.weight’, ‘conv3.0.bias’, ‘fc4.0.weight’, ‘fc4.0.bias’, ‘fc5.1.weight’, ‘fc5.1.bias’])
Where did fc4.0.weight and fc4.0.bias come from? I load from the exact same .pth file, use the exact same class model, I really have no idea how is it even possible.  Any idea?