Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: grad can be implicitly created only for scalar outputs #7

Open
geekysethi opened this issue Apr 12, 2020 · 0 comments
Open

Comments

@geekysethi
Copy link

mask, _ = gradcam(inputs) File "/home/ashish18024/anaconda3/envs/dl/lib/python3.7/site-packages/gradcam/gradcam.py", line 88, in __call__ return self.forward(input, class_idx, retain_graph) File "/home/ashish18024/anaconda3/envs/dl/lib/python3.7/site-packages/gradcam/gradcam.py", line 70, in forward score.backward(retain_graph=retain_graph) File "/home/ashish18024/anaconda3/envs/dl/lib/python3.7/site-packages/torch/tensor.py", line 118, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/home/ashish18024/anaconda3/envs/dl/lib/python3.7/site-packages/torch/autograd/__init__.py", line 87, in backward grad_tensors = _make_grads(tensors, grad_tensors) File "/home/ashish18024/anaconda3/envs/dl/lib/python3.7/site-packages/torch/autograd/__init__.py", line 28, in _make_grads raise RuntimeError("grad can be implicitly created only for scalar outputs") RuntimeError: grad can be implicitly created only for scalar outputs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant