Open is8xia opened 11 months ago
@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?
@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)
@XinzheGeng Thank you, I have achieved it
谢谢你,我做到了
你好,请问是否可以分享你完成的代码。
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.
@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)]
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',不知道你在使用的时候是否遇到过这个问题,想请教一下你如何解决实现可视化。
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
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?