Now i am trying ResNet18
def fuse_model(self):
for m in self.modules():
if type(m) == BasicBlock:
torch.quantization.fuse_modules(m, [[‘conv1’, ‘bn1’, ‘relu’],[‘conv2’, ‘bn2’]], inplace=True)
conv = getattr(m, ‘downsample’)
if(conv) :
torch.quantization.fuse_modules(conv, [‘0’, ‘1’], inplace=True)
But fusion is not giving any error.
But the infernce shows the error (which i posted above)
Got it !!!
I missed the following:
torch.quantization.fuse_modules(self, [‘conv1’, ‘bn1’, ‘relu’], inplace=True)
Thank you