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

Heat map issues #3

Open
is8xia opened this issue Nov 6, 2023 · 9 comments
Open

Heat map issues #3

is8xia opened this issue Nov 6, 2023 · 9 comments

Comments

@is8xia
Copy link

is8xia commented Nov 6, 2023

hello
Thanks for sharing your source code!
On my side, I would like to ask you how the heat map in your Figure 7 is realized?

@is8xia is8xia changed the title 热力图问题 Heat map issues Nov 6, 2023
@is8xia
Copy link
Author

is8xia commented Nov 12, 2023

@XinzheGeng
Thank you for your reply.
But there is a problem, in change detection the input image is two, how do you go about getting the heat map via grad_cam?
Can you provide an idea or source code?

@XinzheGeng
Copy link
Contributor

@is8xia
You can try to modify the code of the network: Merge the bitemporal images into the network, and modify the code of forward() as follow.
x1, x2 = torch.unsqueeze(x1[0], dim=0), torch.unsqueeze(x1[1], dim=0)

@is8xia
Copy link
Author

is8xia commented Nov 14, 2023

@XinzheGeng
Thank you, I have achieved it

@is8xia is8xia closed this as completed Nov 14, 2023
@is8xia is8xia reopened this Nov 14, 2023
@bobo59
Copy link

bobo59 commented Jan 5, 2024

谢谢你,我做到了

你好,请问是否可以分享你完成的代码。

@adleess
Copy link

adleess commented Mar 24, 2024

hello
When i using grad-cam, there will be an error:' grad can be implicitly created only for scalar outputs', I don't know if you have encountered this problem when using it, and I would like to ask you how to realize the visualization.

@is8xia
Copy link
Author

is8xia commented Mar 27, 2024

@bobo59 Change the input to the grad source code. Change the input to a splice of two images and separate the spliced images in the network.
input_tensor = [torch.unsqueeze(imgA_tensor, dim=0), torch.unsqueeze(imgB_tensor, dim=0)]

@is8xia
Copy link
Author

is8xia commented Mar 27, 2024

Check if the output of your network is a tensor or a tuple, the output of the network needed for grad_cam should be a single tensor.

你好, 当我使用grad-cam时,会出现错误:'grad can beimplicitly create only for scalaroutputs',不知道你在使用的时候是否遇到过这个问题,想请教一下你如何解决实现可视化。

@adleess
Copy link

adleess commented Mar 27, 2024

Check if the output of your network is a tensor or a tuple, the output of the network needed for grad_cam should be a single tensor.

你好, 当我使用grad-cam时,会出现错误:'grad can beimplicitly create only for scalaroutputs',不知道你在使用的时候是否遇到过这个问题,想请教一下你如何解决实现可视化。

Thank you for your help, I've solved the problem

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

4 participants