Solved by ekremcet in post #2 
              
              
                Okay found the mistake, I defined the optimizer before the quantized model. Moving the optimizer line after the model declaration fixed the issue