Closed tuji-sjp closed 4 years ago
I cannot guess what caused the error because:
target_layer_names
.About another repository? https://github.com/jacobgil/pytorch-grad-cam/blob/master/grad-cam.py#L76
Oh, this is indeed the code of another repository, I made a mistake, so sorry. And "target_layer_names" is yours "target_layer".
In this repository, you can get various maps as follows:
$ python main.py demo1 --arch "inception_v3" --target-layer "Mixed_7c" -i "samples/cat_dog.png"
$ python main.py demo1 --arch "densenet161" --target-layer "features" -i "samples/cat_dog.png"
Please note that:
F.relu
not only nn.ReLU
which my code cannot handle.Hello, I fused the logits of the three models. Maybe you know how does this ensemble model gets its GradCAM?
I find the "target_layer_names" of these two models, but when I run the modified code, I get the following error:
RuntimeError: size mismatch, m1: [1 x 277248], m2: [768 x 1000] at /opt/conda/conda-bld/pytorch_1535490206202/work/aten/src/THC/generic/THCTensorMathBlas.cu:249
How do I solve it? Please help me, thank you very much!