Hi @Vasiliy_Kuznetsov
Please check the updated quantized_model now -

  
      github.com
  
  
    raghavgurbaxani/Quantization_Experiments/blob/master/quantized_model.txt 3
Size (MB): 6.712286
DataParallel(
  (module): East(
    (mobilenet): MobileNetV2(
      (features): Sequential(
        (0): Sequential(
          (0): ConvBnReLU2d(
            (0): Conv2d(
              3, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False
              (activation_post_process): MinMaxObserver(min_val=-694.3411254882812, max_val=765.30712890625)
            )
            (1): BatchNorm2d(
              32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True
              (activation_post_process): MinMaxObserver(min_val=-4.2157487869262695, max_val=4.755300998687744)
            )
            (2): ReLU(
              (activation_post_process): MinMaxObserver(min_val=0.0, max_val=4.755300998687744)
            )
          )
          (1): Identity()


  This file has been truncated. show original

  
  
    
    
  
  


it seems to have quantized covolutions (line 100 onwards). I don’t know why the layers before line 100 do not have quantized modules.
Do you think my quantstub and dequantstub placement is incorrect ?
Here’s the model (with quant and dequant stub)

  
      github.com
  
  
    raghavgurbaxani/Quantization_Experiments/blob/master/model.py 5
import torch.nn as nn
import math
import torch
import config as cfg
import utils
from torch.quantization import QuantStub, DeQuantStub

def conv_bn(inp, oup, stride):
    return nn.Sequential(
        nn.Conv2d(inp, oup, 3, stride, 1, bias=False),
        nn.BatchNorm2d(oup),
        nn.ReLU(inplace=True)
    )


class InvertedResidual(nn.Module):
    def __init__(self, inp, oup, stride, expand_ratio):
        super(InvertedResidual, self).__init__()
        self.stride = stride
        assert stride in [1, 2]


  This file has been truncated. show original

  
  
    
    
  
  


Main script here - https://github.com/raghavgurbaxani/Quantization_Experiments/blob/master/try_qat.py 1
I suspect maybe my quant and dequant stub may be incorrect but apart from that I’ve followed all the steps as posted in the static quantization tutorial.
Reallly appreciate your help