- Working on Windows with Pytorch 1.9.1+cu102
- I have an object detector that runs with a Torchvision FP32 ResNet-18 backbone.
- Added
QuantStub
andDequantStub
to my model, calling the quant stub on the input and the dequant stub on the output (in the model’s forward method) - Quantized the model using fbgemm
When the ResNet model tries to perform out += identity
(From Torchvision implementation, BasicBlock
class), I get the following error:
File "d:\anaconda3\lib\site-packages\torchvision\models\resnet.py", line 80, in forward
out += identity
NotImplementedError: Could not run 'aten::add.out' with arguments from the 'QuantizedCPU' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'aten::add.out' is only available for these backends: [CPU, CUDA, Meta, MkldnnCPU, SparseCPU, SparseCUDA, SparseCsrCPU, BackendSelect, Named, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, UNKNOWN_TENSOR_TYPE_ID, AutogradMLC, AutogradHPU, AutogradNestedTensor, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, Tracer, Autocast, Batched, VmapMode].
How can I overcome it?