I also meet this kind inconsistent before.
So I give up use ScriptModel, instead I build a parser to parse ScriptModel.graph IR.
Then use the IR label to access state_dict
But the IR is not public release, it still not a good idea to handle this issue (because IR may change between different version)
I think this is a pytorch bug, need pytorch to fix it.