I worked with the pytorch tutorial for static quantization and when running the line:
I receive the following warning:
.../torch/quantization/observer.py:845: UserWarning: must run observer before calling calculate_qparams. Returning default scale and zero point
I call the
convert function within the following lines of code:
per_channel_quantized_model = load_model(..) per_channel_quantized_model.eval() per_channel_quantized_model.fuse_model() per_channel_quantized_model.qconfig = torch.quantization.get_default_qconfig('fbgemm') print(per_channel_quantized_model.qconfig) torch.quantization.prepare(per_channel_quantized_model, inplace=True) evaluate(per_channel_quantized_model, ...) torch.quantization.convert(per_channel_quantized_model, inplace=True)
Does somebody have an idea what the warning means and how I can avoid that? I appreciate any hints and suggestions!