[Quantization] (Error): No function is registered for schema aten

I tried to quantizate my own shuffle model through 'STATIC QUANTIZATION WITH EAGER MODE IN PYTORCH'.
But when it comes to forward propagation, the time to assess model losses, I failed

RuntimeError: No function is registered for schema aten::native_batch_norm(Tensor input, Tensor? weight, Tensor? bias, Tensor? running_mean, Tensor? running_var, bool training, float momentum, float eps) -> (Tensor, Tensor, Tensor) on tensor type QuantizedCPUTensorId; available functions are CPUTensorId, CUDATensorId, MkldnnCPUTensorId, VariableTensorId
The above operation failed in interpreter, with the following stack trace:
at code/ torch /shuff_slim/___torch_mangle_297.py:316:13

Please fold batchnorms with preceding convs manually. Look for the APIs to do this for you in the Resnext-101 tutorial.

1 Like

@dskhudia could you share the link for the Resnext 101 tutorial?

Or could you provide an example ? That would be very helpful

You can find tutorial for post training static quantization here: https://pytorch.org/tutorials/advanced/static_quantization_tutorial.html