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

resnet #1

Open
danmlevi opened this issue Dec 29, 2020 · 1 comment
Open

resnet #1

danmlevi opened this issue Dec 29, 2020 · 1 comment

Comments

@danmlevi
Copy link

Amazing work Shir!
When I try using a resnet model in the example:
model = resnet18(pretrained=True).to(device)
I get the following error:

Traceback (most recent call last):
File "/home/kzfm0t/code/visualization/AGFVisualization-master/example.py", line 97, in
dog = get_visualization(out)
File "/home/kzfm0t/code/visualization/AGFVisualization-master/example.py", line 73, in get_visualization
return model.AGF(**kwargs)
File "/home/kzfm0t/code/visualization/AGFVisualization-master/modules/resnet.py", line 227, in AGF
cam, grad_outputs = self.layer4.AGF(cam, grad_outputs, **kwargs)
File "/home/kzfm0t/code/visualization/AGFVisualization-master/modules/layers.py", line 428, in AGF
cam, grad_outputs = m.AGF(cam, grad_outputs, **kwargs)
File "/home/kzfm0t/code/visualization/AGFVisualization-master/modules/resnet.py", line 82, in AGF
return self.clone.AGF((cam, cam2), grad_outputs + grad_outputs2)
TypeError: add(): argument 'other' (position 1) must be Tensor, not tuple

Process finished with exit code 1
Couldn't fix it immediately by making it a 2-tupple

@shirgur
Copy link
Owner

shirgur commented Dec 29, 2020

Thank you,
Please use ResNet50 for now

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

2 participants