Load_state_dict with strict=False returns IncompatibleKeys tuple

The current load_state_dict API with strict=False returns an IncompatibleKeys named tuple which is misleading in the case of successful loading of weights. I don’t think IncompatibleKeys is the correct name for a return object for loading the state dict. I was thrown off for a while trying to figure out why I was repeatedly getting the same IncompatibleKeys error with strict=False before realizing that was actually the return object itself.

This issue was tracked here and should be fixed in the current master or nightly build by now.
Could you check it again with one of the current versions?

1 Like