pytorch-grad-cam
pytorch-grad-cam copied to clipboard
AssertionError of FullGrad for the inception_v3 model
trafficstars
For the inception_v3 model in torchvision.models, FullGrad attribution arises the AssertionError about "assert(len(self.bias_data) == len(grads_list))"; I find that the len(self.bias_data) is 96 while len(grads_list)is just 94 when steps into the functions.
It is just from the normal-usage of the function,
model = torchvision.models.inception_v3(weights=models.Inception_V3_Weights.IMAGENET1K_V1) fg = FullGrad(model, [], use_cuda=True) # FullGrad will ignore the given target_layers, so here it is an empty list attr = fg(input_tensor=x.to(device), targets=[ClassifierOutputTarget(tar_clsidx)])
Does anyone also encounter such a problem? Or any suggestions? @jacobgil