You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For calibration, I used 5 inputs with different levels of noise. Then I tested the quantized model on exactly the same inputs using the command below: snpe-net-run --container Quant_MODEL_NAME.dlc --input_list Inputlist.txt
The quality is lower, but the difference is acceptable. On average, there is a drop from 37.77 dB to 37.17.
To have more control over quantization, I wanted to use AIMET. I used the code below to obtain the quantized model:
Later, I evaluated the quantized model on the same 5 inputs, but the obtained results were very poor, with an average PSNR of 25 dB. For evaluation, I used the following code:
eval_dataset = LabeledDatasetWrapper()
for n, (input_data, clean) in enumerate(eval_dataset):
input_dict = {'0' : input_data[None, :]}
print(input_dict['0'].shape)
outputs = sim.session.run(None, input_dict)
output_name = sim.session.get_outputs()[0].name
print(psnr(torch.tensor(outputs[0]), torch.tensor(clean)))
I presume that 5 inputs are not enough, but the difference between the obtained results is very confusing for me. Could you tell me what I can do to obtain the same results with AIMET as with SNPE quantization? Are there any mistakes in the current AIMET approach?
The text was updated successfully, but these errors were encountered:
@Piotr94, AIMET does not support adjusted_weights_quantizer, could you disable it SNPE as well. Also, are you using Per channel quantization in AIMET, since it is being used with SNPE in your code?
I presume that 5 inputs are not enough, but the difference between the obtained results is very confusing for me.
Thanks for your answer. Indeed i didn't use per channel quantization in AIMET but I don't see how could I set it. In the documentation for QuantSimModel (link) I couldn't find such option. Can you tell where can I find it/ how can I enable it?
I would like to ask some questions about the difference between AIMET and SNPE quantization.
I am attempting to perform quantization of the video denoising model.
I started with SNPE and used the following commands:
For calibration, I used 5 inputs with different levels of noise. Then I tested the quantized model on exactly the same inputs using the command below:
snpe-net-run --container Quant_MODEL_NAME.dlc --input_list Inputlist.txt
The quality is lower, but the difference is acceptable. On average, there is a drop from 37.77 dB to 37.17.
To have more control over quantization, I wanted to use AIMET. I used the code below to obtain the quantized model:
Then, for calibration, I used the same 5 inputs as for SNPE:
Later, I evaluated the quantized model on the same 5 inputs, but the obtained results were very poor, with an average PSNR of 25 dB. For evaluation, I used the following code:
I presume that 5 inputs are not enough, but the difference between the obtained results is very confusing for me. Could you tell me what I can do to obtain the same results with AIMET as with SNPE quantization? Are there any mistakes in the current AIMET approach?
The text was updated successfully, but these errors were encountered: