Hello,
I’ve read the excellent static quantization tutorial, which worked really well with my MobileNet_v2  pretrained weights
  
      pytorch.org
  
  
    

(beta) Static Quantization with Eager Mode in PyTorch — PyTorch Tutorials... 3



  
  
    
    
  
  


Now I want to do the same with Inception_v3 model. Thing is,  when I try to load the state dictionary I get the following error (full trace bellow), why and how do I fix that? Do I need to create a new class as they did in the tutorial?

per_channel_quantized_model = torchvision.models.quantization.inception_v3(pretrained=True, aux_logits=False, quantize=True)
per_channel_quantized_model.fc = nn.Linear(2048, 2)
state_dict = torch.load(float_model_file, map_location=torch.device(‘cpu’))
per_channel_quantized_model.load_state_dict(state_dict)


File “”, line 5, in 
per_channel_quantized_model.load_state_dict(state_dict)
File “/home/nimrod/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 1030, in load_state_dict
load(self)
File “/home/nimrod/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 1028, in load
load(child, prefix + name + ‘.’)
File “/home/nimrod/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 1028, in load
load(child, prefix + name + ‘.’)
File “/home/nimrod/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py”, line 1025, in load
state_dict, prefix, local_metadata, True, missing_keys, unexpected_keys, error_msgs)
File “/home/nimrod/anaconda3/lib/python3.7/site-packages/torch/nn/quantized/modules/conv.py”, line 120, in _load_from_state_dict
state_dict[prefix + ‘weight’], state_dict[prefix + ‘bias’])
KeyError: ‘Conv2d_1a_3x3.conv.bias’