PyTorch quantization resnet50 model

Hi all,
I am trying the resnet50 model quantization with PyTorch and I tried these 3 lines of code :
the import, model=qn.resnet50(pretrain=true), and model.state_dict()), and why the coefficients being shown are all float values if this is the quarantined version of the model?
Noticed this while trying to figure out how to save/load the coefficients for a quantized model, and is there anything special you need to do convert model coefficients between float and int8.

Please let me know. Appreciate any help/suggestions , Thanks!

Can anyone help me with this please?

check out https://pytorch.org/docs/stable/quantization.html#quantized-torch-tensor-operations, in partucular the ā€œint_reprā€ function. By default, if you print out a quantized tensor you will see the dequantized values that the tensor represents. To see the raw int8 values, you can use x.int_repr().

1 Like

Thank you so much for your response,I will check it.Thanks again.

HI,I tried this but it gives me this error:
RuntimeError: Could not run ā€˜aten::int_reprā€™ with arguments from the ā€˜CPUTensorIdā€™ backend. ā€˜aten::int_reprā€™ is only available for these backends: [QuantizedCPUTensorId, VariableTensorId].