SystemError while using ConstrastiveExcitationBackprop
Opened this issue · 0 comments
Thanks for the nice repo!
I came across an Error while generating saliency map with ConstrastiveExcitationBackprop. The system dependence is the following:
*ubuntu: 16.04.1
*python: 3.6.5
*torch: 1.4.0
*torchvision: 0.5.0
And the error log is the following:
File "/home/lxh/anaconda3/envs/pyt1.1/lib/python3.6/site-packages/torchray/attribution/excitation_backprop.py", line 729, in contrastive_excitation_backprop
output.backward(gradient)
File "/home/lxh/anaconda3/envs/pyt1.1/lib/python3.6/site-packages/torch/tensor.py", line 195, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/lxh/anaconda3/envs/pyt1.1/lib/python3.6/site-packages/torch/autograd/init.py", line 99, in backward
allow_unreachable=True) # allow_unreachable flag
File "/home/lxh/anaconda3/envs/pyt1.1/lib/python3.6/site-packages/torch/autograd/function.py", line 77, in apply
return self.forward_cls.backward(self, *args)
File "/home/lxh/anaconda3/envs/pyt1.1/lib/python3.6/site-packages/torchray/attribution/excitation_backprop.py", line 385, in backward
input = ctx.saved_tensors[0].detach()
SystemError: <built-in method detach of Tensor object at 0x7fc8c5804168> returned a result with an error set
When I downgrade the torch version to 1.1.0 and torchvision version to 0.3.0. This issue will not appear.
Although it works for the older version for torch, I'm thinking maybe you can check this issue out?