Hi @Vasiliy_Kuznetsov,
Thanks for your help, I was actually just working on this. I ended up fixing it like this:
# This is a temporary fix for https://discuss.pytorch.org/t/loading-quantized-model-from-state-dict-with-version-none/89042
model_checkpoint['state_dict'] = OrderedDict(model_checkpoint['state_dict'])
if not hasattr(model_checkpoint['state_dict'], '_metadata'):
     setattr(model_checkpoint['state_dict'], '_metadata', OrderedDict({'version': 2}))

Your code seems more specific, I wonder if mine could break. For now I only really need to change the version for the Linear layer so I don’t know if doing it like this is going to break something else.
I will file a Github issue!