flashtorch icon indicating copy to clipboard operation
flashtorch copied to clipboard

When I test my demo.jpg[BUG]

Open cymqqqq opened this issue 4 years ago • 0 comments

AttributeError Traceback (most recent call last) in () 4 input_=apply_transforms(image) 5 target_class=24 ----> 6 backprop.visualize(input,target_class,guided=True)

1 frames /usr/local/lib/python3.6/dist-packages/flashtorch/saliency/backprop.py in calculate_gradients(self, input_, target_class, take_max, guided, use_gpu) 84 self.model.zero_grad() 85 ---> 86 self.gradients = torch.zeros(input_.shape) 87 88 # Get a raw prediction value (logit) from the last linear layer

AttributeError: 'function' object has no attribute 'shape'

how to fix it?

cymqqqq avatar Aug 08 '20 09:08 cymqqqq