This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Quantization Aware Training (QAT) using edgeai-torchvision repository

Part Number: TDA4VM

Hi,

The training flow I'm using is as-

  • Taking a trained model that I want to use, loading its weights
  • Replacing the relevant layers to TI implementation (Upsample -> xnn.layers.ResizeWith, Concat -> xnn.layers.CatBlock)
  • Wrapping the modified model with xnn.quantize.QuantTrainModule class
  • Training 50 epochs, with "small" learning rate values

These step were done with many hyper parameters changes- LR changes, adding/removing weights decay:

  • Tried with/without freezing BatchNorm and Quantization range as advised in the guide (using xnn.utils.freeze_bn(model) and xnn.layers.freeze_quant_range(model))
  • While training is being done - it can be seem that the training loss value if very much bigger than the one I get without the QAT flow, and seem that nothing of the described experiments improves it (about x5 bigger than without QAT flow)
The inference flow I'm using with the trained QAT model-
  • When testing the trained model, I use torch.load + load_state_dict (using the weights of each model after the replacement of the relevant layers (concat, upsample) as done before training
  • The tested model have severe localization problems, accuracy drops dramatically

Would appreciate your guidance if the described flow seems reasonable, and if there's something that might be recommended to try (maybe hyper parameters tuning or other suggested methods).
Thanks in advance!